Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
190:3eb53c957d10 | 191:aa54250f58ac |
---|---|
1 datatype option a = None | Some of a | |
2 | |
3 val none : option int = None | |
4 val some_1 : option int = Some 1 | |
5 | |
6 val f = fn t ::: Type => fn x : option t => | |
7 case x of None => None | Some x => Some (Some x) | |
8 | |
9 val none_again = f none | |
10 val some_1_again = f some_1 |