From b314c01095c5cd4617f71f706e43530a57ffb65b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 2 May 2012 08:34:50 -0400 Subject: Better discovery of type class instances from recursive definitions --- tests/newMessage.ur | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/newMessage.ur (limited to 'tests') 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}) -- cgit v1.2.3