summaryrefslogtreecommitdiff
path: root/transfer/examples/array.tr
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-28 21:45:22 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-28 21:45:22 +0000
commit02c23401a7a3e54d48084fc2796a485de36383f1 (patch)
tree03574e9f1c862f2b5685741c6c9d8ee8029aea21 /transfer/examples/array.tr
parent5a82068ddc0e75ee2f2280ffb5da9cda3e53bac3 (diff)
Changed all example programs to use layout syntax.
Diffstat (limited to 'transfer/examples/array.tr')
-rw-r--r--transfer/examples/array.tr15
1 files changed, 7 insertions, 8 deletions
diff --git a/transfer/examples/array.tr b/transfer/examples/array.tr
index 7dcf6d443..e91fe35e7 100644
--- a/transfer/examples/array.tr
+++ b/transfer/examples/array.tr
@@ -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)