summaryrefslogtreecommitdiff
path: root/transfer/lib/collection.tra
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-26 21:05:01 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-26 21:05:01 +0000
commitfb1d9b7d2c3c8261fc5a2ce3698e6749458b207a (patch)
tree466adc81f2c6ac803d20804863927c076e2b243a /transfer/lib/collection.tra
parent33eb6d899fef48f2d38a92bc0fab66ff585be553 (diff)
removed transfer from gf3
Diffstat (limited to 'transfer/lib/collection.tra')
-rw-r--r--transfer/lib/collection.tra77
1 files changed, 0 insertions, 77 deletions
diff --git a/transfer/lib/collection.tra b/transfer/lib/collection.tra
deleted file mode 100644
index 59b71a5e9..000000000
--- a/transfer/lib/collection.tra
+++ /dev/null
@@ -1,77 +0,0 @@
--- NOTE: this is unfinished and untested
-
-import prelude
-import bintree
-
-Collection : Type -> Type
-Collection C =
- sig
- -- types
- Elem : Type
- -- Add stuff
- zero : C
- plus : C -> C -> C
- -- Collection-specific stuff
- size : C -> Integer
- add : Elem -> C -> C
- elem : Elem -> C -> Bool
- map : (Elem -> Elem) -> C -> C
- filter : (Elem -> Bool) -> C -> C
- fromList : List Elem -> C
- toList : C -> List Elem
-
-
---
--- Collection String instance
---
-
-collection_String : Collection String
-collection_String =
- rec
- Elem = Char
- zero = ""
- plus = prim_add_String
- size = prim_length_String
- -- ...
-
-
---
--- Collection List instance
---
-
-collection_List : (A : Type) -> Collection (List A)
-collection_List A =
- rec
- Elem = A
- zero = Nil A
- plus = append A
- size = length A
- add = Cons A
- -- ...
-
---
--- Collection Vector instance
---
-
-collection_Vector : (A : Type) -> (n : Nat) -> Collection (Vector A n)
-collection_Vector A n =
- rec
- Elem = A
- zero = Empty A
- plus = appendV A n n -- FIXME: this only works for vectors of the same length!
- -- ...
-
-
---
--- Collection BinTree instance
---
-
-collection_BinTree : (A : Type) -> Ord A -> Collection (BinTree A)
-collection_BinTree A o =
- rec
- Elem = A
- zero = Nil A
- plus = merge A o
- size = sizeBT A
- add = insert A o
- -- ...