Mercurial > urweb
comparison tests/type_class.ur @ 244:71bafe66dbe1
Laconic -> Ur
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 31 Aug 2008 08:32:18 -0400 |
parents | tests/type_class.lac@ba4d7c33a45f |
children | fab5998b840e |
comparison
equal
deleted
inserted
replaced
243:2b9dfaffb008 | 244:71bafe66dbe1 |
---|---|
1 class default t = t | |
2 | |
3 val string_default : default string = "Hi" | |
4 val int_default : default int = 0 | |
5 | |
6 val default : t :: Type -> default t -> t = | |
7 fn t :: Type => fn d : default t => d | |
8 val hi = default [string] _ | |
9 val zero = default [int] _ | |
10 | |
11 val frob : t :: Type -> default t -> t = | |
12 fn t :: Type => fn _ : default t => default [t] _ | |
13 val hi_again = frob [string] _ | |
14 val zero_again = frob [int] _ | |
15 | |
16 val main : unit -> page = fn () => <html><body> | |
17 {cdata hi_again} | |
18 </body></html> |