From cba2fcb9b118cedb603b171ac7d7581c5adb844c Mon Sep 17 00:00:00 2001 From: bringert Date: Wed, 30 Nov 2005 16:00:06 +0000 Subject: Moved transfer libraries to transfer/lib --- transfer/lib/array.tr | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 transfer/lib/array.tr (limited to 'transfer/lib/array.tr') 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) -- cgit v1.2.3