summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-22 18:20:13 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-22 18:20:13 -0400
commitcedc70524a84b860f438078c8abc6f1aa0557994 (patch)
tree735510b51e40a85f11b4b16dedfd9ec00d73a469 /tests
parentda42860153178241d05f7aaa0ecac39b5982e689 (diff)
Fix opening and corifying of functors
Diffstat (limited to 'tests')
-rw-r--r--tests/gform.lac31
-rw-r--r--tests/open_functor.lac16
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/gform.lac b/tests/gform.lac
new file mode 100644
index 00000000..51df468c
--- /dev/null
+++ b/tests/gform.lac
@@ -0,0 +1,31 @@
+con stringify = fold (fn nm :: Name => fn u :: Unit => fn t :: {Type} => [nm = string] ++ t) []
+
+signature S = sig
+ con rs :: {Unit}
+end
+
+signature S' = sig
+ con rs :: {Unit}
+
+ val handler : $(stringify rs) -> page
+ val page : unit -> page
+end
+
+functor F (M : S) : S' where con rs = M.rs = struct
+ con rs = M.rs
+
+ val handler = fn x : $(stringify M.rs) => <html><body>
+ OK.
+ </body></html>
+
+ val page = fn () => <html><body>
+
+ </body></html>
+end
+
+structure M = F(struct
+ con rs = []
+end)
+
+open M
+
diff --git a/tests/open_functor.lac b/tests/open_functor.lac
new file mode 100644
index 00000000..36525a05
--- /dev/null
+++ b/tests/open_functor.lac
@@ -0,0 +1,16 @@
+signature S = sig
+ type t
+ val x : t
+end
+
+functor F (M : S) : S where type t = M.t = struct
+ type t = M.t
+ val x = M.x
+end
+
+structure M = F(struct
+ type t = int
+ val x = 0
+end)
+
+open M