Mercurial > urweb
comparison src/core_print.sml @ 214:766b5475477f
Corifying con-tuples
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 Aug 2008 15:03:05 -0400 |
parents | df5fd8f6913a |
children | 71bafe66dbe1 |
comparison
equal
deleted
inserted
replaced
213:0343557355fc | 214:766b5475477f |
---|---|
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 |
135 string "++", | 138 string "++", |
136 space, | 139 space, |
137 p_con env c2]) | 140 p_con env c2]) |
138 | CFold _ => string "fold" | 141 | CFold _ => string "fold" |
139 | CUnit => string "()" | 142 | CUnit => string "()" |
143 | |
144 | CTuple cs => box [string "(", | |
145 p_list (p_con env) cs, | |
146 string ")"] | |
147 | CProj (c, n) => box [p_con env c, | |
148 string ".", | |
149 string (Int.toString n)] | |
140 | 150 |
141 and p_con env = p_con' false env | 151 and p_con env = p_con' false env |
142 | 152 |
143 and p_name env (all as (c, _)) = | 153 and p_name env (all as (c, _)) = |
144 case c of | 154 case c of |