summaryrefslogtreecommitdiff
path: root/tests/newMessage.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-05-02 08:34:50 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-05-02 08:34:50 -0400
commit457b3c776325042c81b0cb5804e7881e0c1d1bf3 (patch)
tree88076906dd1130c5cfd2657d40e8641aac59c0e7 /tests/newMessage.ur
parent59ea8e278e94c7ea7989a6ece4bbb1a99110e93f (diff)
Better discovery of type class instances from recursive definitions
Diffstat (limited to 'tests/newMessage.ur')
-rw-r--r--tests/newMessage.ur15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/newMessage.ur b/tests/newMessage.ur
new file mode 100644
index 00000000..e6ae3b4e
--- /dev/null
+++ b/tests/newMessage.ur
@@ -0,0 +1,15 @@
+datatype message = NewQuestion of { Id : string}
+ | Something of {Blah : int}
+
+fun showMessage (message : message) =
+ case message of
+ NewQuestion {Id = a} => a
+ | Something {Blah = x} => "blah"
+
+val show_mes = mkShow showMessage
+
+fun showTwoTuple [a] [b] (_ : show a) (_: show b) = mkShow (fn (two_tuple : {1:a, 2:b}) =>
+ "(" ^ show two_tuple.1 ^ ", " ^ show two_tuple.2 ^ ")"
+
+ )
+val om = show (Something {Blah = 1}, Something {Blah = 2})