This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
22 lines
444 B
Text
22 lines
444 B
Text
namespace Ex
|
||
|
||
class Get (Cont : Type u) (Idx : Type v) (Elem : outParam (Type w)) where
|
||
get (xs : Cont) (i : Idx) : Elem
|
||
|
||
export Get (get)
|
||
|
||
instance [Inhabited α] : Get (Array α) Nat α where
|
||
get xs i := xs[i]!
|
||
|
||
instance : Coe Bool Nat where
|
||
coe b := if b then 1 else 0
|
||
|
||
def g (as : Array (Array Bool)) : Nat :=
|
||
let bs := get as 0
|
||
get bs 0
|
||
|
||
def h (as : Array (Array Bool)) (i : Nat) : Nat :=
|
||
let bs := get as i
|
||
get bs i
|
||
|
||
end Ex
|