summaryrefslogtreecommitdiff
path: root/lib/ur/list.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 08:13:54 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 08:13:54 -0400
commitae8c16af976173ab73c63dd0ca7b9dc2183b3d6b (patch)
treecd83a1670f329d23e70b5b1017d2ead58829009c /lib/ur/list.ur
parent90d8c8cb498fd7aacd19682d2979186e76805808 (diff)
Improving/reordering Unpoly and Especialize; pathmaps
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r--lib/ur/list.ur31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur
new file mode 100644
index 00000000..5310c810
--- /dev/null
+++ b/lib/ur/list.ur
@@ -0,0 +1,31 @@
+datatype t = datatype Basis.list
+
+val show (a ::: Type) (_ : show a) =
+ let
+ fun show' (ls : list a) =
+ case ls of
+ [] => "[]"
+ | x :: ls => show x ^ " :: " ^ show' ls
+ in
+ mkShow show'
+ end
+
+val rev (a ::: Type) =
+ let
+ fun rev' acc (ls : list a) =
+ case ls of
+ [] => acc
+ | x :: ls => rev' (x :: acc) ls
+ in
+ rev' []
+ end
+
+fun mp (a ::: Type) (b ::: Type) f =
+ let
+ fun mp' acc ls =
+ case ls of
+ [] => rev acc
+ | x :: ls => mp' (f x :: acc) ls
+ in
+ mp' []
+ end