Mercurial > urweb
diff tests/pvar.ur @ 1287:5137b0537c92
Polymorphic variants
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 19 Aug 2010 17:28:52 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/pvar.ur Thu Aug 19 17:28:52 2010 -0400 @@ -0,0 +1,5 @@ +val v1 : variant [A = int, B = float] = make [#A] 1 +val v2 : variant [A = int, B = float] = make [#B] 2.3 + +fun main () = return (match v1 {A = fn n => <xml>A: {[n]}</xml>, + B = fn n => <xml>B: {[n]}</xml>})