view 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
line wrap: on
line source
class default t = t

val string_default : default string = ""
val int_default : default int = 0

val default : t :: Type -> default t -> t =
        fn t :: Type => fn d : default t => d
val empty = default [string] _
val zero = default [int] _