comparison src/explify.sml @ 188:8e9f97508f0d

Datatype representation optimization
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 19:49:21 -0400
parents d11754ffe252
children aa54250f58ac
comparison
equal deleted inserted replaced
187:fb6ed259f5bd 188:8e9f97508f0d
79 fun explifyPat (p, loc) = 79 fun explifyPat (p, loc) =
80 case p of 80 case p of
81 L.PWild => (L'.PWild, loc) 81 L.PWild => (L'.PWild, loc)
82 | L.PVar (x, t) => (L'.PVar (x, explifyCon t), loc) 82 | L.PVar (x, t) => (L'.PVar (x, explifyCon t), loc)
83 | L.PPrim p => (L'.PPrim p, loc) 83 | L.PPrim p => (L'.PPrim p, loc)
84 | L.PCon (pc, po) => (L'.PCon (explifyPatCon pc, Option.map explifyPat po), loc) 84 | L.PCon (dk, pc, po) => (L'.PCon (dk, explifyPatCon pc, Option.map explifyPat po), loc)
85 | L.PRecord xps => (L'.PRecord (map (fn (x, p, t) => (x, explifyPat p, explifyCon t)) xps), loc) 85 | L.PRecord xps => (L'.PRecord (map (fn (x, p, t) => (x, explifyPat p, explifyCon t)) xps), loc)
86 86
87 fun explifyExp (e, loc) = 87 fun explifyExp (e, loc) =
88 case e of 88 case e of
89 L.EPrim p => (L'.EPrim p, loc) 89 L.EPrim p => (L'.EPrim p, loc)