Mercurial > urweb
comparison src/expl_print.sml @ 213:0343557355fc
Explifying type classes
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 Aug 2008 14:45:23 -0400 |
parents | 8a70e2919e86 |
children | 71bafe66dbe1 |
comparison
equal
deleted
inserted
replaced
212:ba4d7c33a45f | 213:0343557355fc |
---|---|
47 space, | 47 space, |
48 p_kind k2]) | 48 p_kind k2]) |
49 | KName => string "Name" | 49 | KName => string "Name" |
50 | KRecord k => box [string "{", p_kind k, string "}"] | 50 | KRecord k => box [string "{", p_kind k, string "}"] |
51 | KUnit => string "Unit" | 51 | KUnit => string "Unit" |
52 | KTuple ks => box [string "(", | |
53 p_list_sep (box [space, string "*", space]) p_kind ks, | |
54 string ")"] | |
52 | 55 |
53 and p_kind k = p_kind' false k | 56 and p_kind k = p_kind' false k |
54 | 57 |
55 fun p_con' par env (c, _) = | 58 fun p_con' par env (c, _) = |
56 case c of | 59 case c of |
145 string "++", | 148 string "++", |
146 space, | 149 space, |
147 p_con env c2]) | 150 p_con env c2]) |
148 | CFold _ => string "fold" | 151 | CFold _ => string "fold" |
149 | CUnit => string "()" | 152 | CUnit => string "()" |
153 | |
154 | CTuple cs => box [string "(", | |
155 p_list (p_con env) cs, | |
156 string ")"] | |
157 | CProj (c, n) => box [p_con env c, | |
158 string ".", | |
159 string (Int.toString n)] | |
150 | 160 |
151 and p_con env = p_con' false env | 161 and p_con env = p_con' false env |
152 | 162 |
153 and p_name env (all as (c, _)) = | 163 and p_name env (all as (c, _)) = |
154 case c of | 164 case c of |