File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import Vec
66return : forall {a : Type} . a -> Vec 1 a
77return x = Cons x Nil
88
9- join : forall {a : Type, b : Type, n m : Nat}
9+ joinM : forall {a : Type, b : Type, n m : Nat}
1010 . Vec n (Vec m a) -> Vec (n * m) a
11- join Nil = Nil;
12- join (Cons xs xss) = xs `append` (join xss)
11+ joinM Nil = Nil;
12+ joinM (Cons xs xss) = xs `append` (joinM xss)
1313
1414-- Functor operation
1515fmap : forall {a : Type, b : Type, n : Nat}
@@ -20,7 +20,7 @@ fmap [f] (Cons x xs) = Cons (f x) (fmap [f] xs)
2020-- Derived bind operation
2121bind : forall {a : Type, b : Type, n m : Nat}
2222 . Vec n a -> (a -> Vec m b) [n] -> Vec (n * m) b
23- bind x f = join (fmap f x)
23+ bind x f = joinM (fmap f x)
2424
2525---------------------------------------------------
2626
Original file line number Diff line number Diff line change 11import Vec
22
3- monus
4- : forall {m n : Nat}
5- . N m -> N n -> N (m - n)
6- monus m Z = m;
7- monus Z (S n') = monus Z n';
8- monus (S m') (S n') = monus m' n'
9-
10-
113pad_left
124 : ∀ {a : Type, m : Nat, n : Nat}
135 . a [n - m]
You can’t perform that action at this time.
0 commit comments