Changed all example programs to use layout syntax.

This commit is contained in:
bringert
2005-11-28 21:45:22 +00:00
parent 576f25b53e
commit 2e16e1e384
10 changed files with 83 additions and 90 deletions

View File

@@ -1,10 +1,9 @@
import nat ;
import nat
data Array : Type -> Nat -> Type where {
Empty : (A:Type) -> Array A Zero ;
Cell : (A:Type) -> (n:Nat) -> A -> Array A n -> Array A (Succ n) ;
} ;
data Array : Type -> Nat -> Type where
Empty : (A:Type) -> Array A Zero
Cell : (A:Type) -> (n:Nat) -> A -> Array A n -> Array A (Succ n)
mapA : (A:Type) -> (B:Type) -> (n:Nat) -> (A -> B) -> Array A n -> Array B n ;
mapA A B _ f (Empty _) = Empty B ;
mapA A B (Succ n) f (Cell _ _ x xs) = Cell B n (f x) (mapA A B n f xs) ;
mapA : (A:Type) -> (B:Type) -> (n:Nat) -> (A -> B) -> Array A n -> Array B n
mapA A B _ f (Empty _) = Empty B
mapA A B (Succ n) f (Cell _ _ x xs) = Cell B n (f x) (mapA A B n f xs)