comparison tests/type_class.lac @ 211:e86411f647c6

Initial type class support
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 14:32:18 -0400
parents
children ba4d7c33a45f
comparison
equal deleted inserted replaced
210:f4033abd6ab1 211:e86411f647c6
1 class default t = t
2
3 val string_default : default string = ""
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 empty = default [string] _
9 val zero = default [int] _