diff options
author | 2008-08-16 16:57:21 -0400 | |
---|---|---|
committer | 2008-08-16 16:57:21 -0400 | |
commit | 7910af6db28602b2fb5d3c9c5227bcc3c076acdc (patch) | |
tree | c204f7a2b75e936a7d0dcfdd76693a1ce1a56daa /tests | |
parent | 2c64a768d33ed6cbead84259a5cefae7d9c6f4e1 (diff) |
Signature ascription for type classes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/type_classMod2.lac | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/type_classMod2.lac b/tests/type_classMod2.lac new file mode 100644 index 00000000..ba700c22 --- /dev/null +++ b/tests/type_classMod2.lac @@ -0,0 +1,18 @@ +signature S = sig + class c + val default : t :: Type -> c t -> t + + val string_c : c string + val int_c : c int +end + +structure M : S = struct + class c t = t + val default = fn t :: Type => fn v : c t => v + + val int_c : c int = 0 + val string_c : c string = "Hi" +end + +val hi = M.default [string] _ +val zero = M.default [int] _ |