Mercurial > urweb
annotate tests/datatypeP.lac @ 191:aa54250f58ac
Parametrized datatypes through explify
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Fri, 08 Aug 2008 10:28:32 -0400 |
parents | |
children | 8a70e2919e86 |
rev | line source |
---|---|
adamc@191 | 1 datatype option a = None | Some of a |
adamc@191 | 2 |
adamc@191 | 3 val none : option int = None |
adamc@191 | 4 val some_1 : option int = Some 1 |
adamc@191 | 5 |
adamc@191 | 6 val f = fn t ::: Type => fn x : option t => |
adamc@191 | 7 case x of None => None | Some x => Some (Some x) |
adamc@191 | 8 |
adamc@191 | 9 val none_again = f none |
adamc@191 | 10 val some_1_again = f some_1 |