summaryrefslogtreecommitdiff
path: root/transfer/lib/array.tr
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-30 16:00:06 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-30 16:00:06 +0000
commitcba2fcb9b118cedb603b171ac7d7581c5adb844c (patch)
tree5f777207338134402d07486d334dcc764d933027 /transfer/lib/array.tr
parent86df2a69b149c1f4ff2cb9139447f5a6faccd483 (diff)
Moved transfer libraries to transfer/lib
Diffstat (limited to 'transfer/lib/array.tr')
-rw-r--r--transfer/lib/array.tr9
1 files changed, 9 insertions, 0 deletions
diff --git a/transfer/lib/array.tr b/transfer/lib/array.tr
new file mode 100644
index 000000000..e91fe35e7
--- /dev/null
+++ b/transfer/lib/array.tr
@@ -0,0 +1,9 @@
+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)
+
+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)