@@ -1,4 +1,4 @@
1−module Data.VectType
1+module Data.VectType
3import Data.Fin
3import Data.Fin
@@ -6,7 +6,7 @@ import Data.Fin
6%default total
6%default total
8namespace Vect {
8namespace Vect {
10infixr 7 ::
10infixr 7 ::
12%elim data Vect : Nat -> Type -> Type where
12%elim data Vect : Nat -> Type -> Type where
@@ -531,6 +531,8 @@ instance Applicative (Vect k) where
532 fs <*> vs = zipWith apply fs vs
532 fs <*> vs = zipWith apply fs vs
534+||| This monad is different from the List monad, (>>=)
535+||| uses the diagonal.
534instance Monad (Vect n) where
536instance Monad (Vect n) where
535 m >>= f = diag (map f m)
537 m >>= f = diag (map f m)
@@ -539,7 +541,7 @@ instance Traversable (Vect n) where
539 traverse f (x::xs) = [| Vect.(::) (f x) (traverse f xs) |]
541 traverse f (x::xs) = [| Vect.(::) (f x) (traverse f xs) |]
541--------------------------------------------------------------------------------
543--------------------------------------------------------------------------------
543--------------------------------------------------------------------------------
545--------------------------------------------------------------------------------
545instance Show a => Show (Vect n a) where
547instance Show a => Show (Vect n a) where
@@ -595,4 +597,3 @@ instance DecEq a => DecEq (Vect n a) where
596-- For the primitives, we have to cheat because we don't have access to their
598-- For the primitives, we have to cheat because we don't have access to their
597-- internal implementations.
599-- internal implementations.