comparison src/monoize.sml @ 288:4260ad920c36

Converting string to int
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 11:33:13 -0400
parents ffe5b01908ae
children df00701f2323
comparison
equal deleted inserted replaced
287:3ed7a7c7b060 288:4260ad920c36
78 | L.TCFun _ => poly () 78 | L.TCFun _ => poly ()
79 | L.TRecord (L.CRecord ((L.KType, _), xcs), _) => 79 | L.TRecord (L.CRecord ((L.KType, _), xcs), _) =>
80 (L'.TRecord (map (fn (x, t) => (monoName env x, mt env dtmap t)) xcs), loc) 80 (L'.TRecord (map (fn (x, t) => (monoName env x, mt env dtmap t)) xcs), loc)
81 | L.TRecord _ => poly () 81 | L.TRecord _ => poly ()
82 82
83 | L.CApp ((L.CFfi ("Basis", "option"), _), t) =>
84 (L'.TOption (mt env dtmap t), loc)
85
83 | L.CApp ((L.CFfi ("Basis", "show"), _), t) => 86 | L.CApp ((L.CFfi ("Basis", "show"), _), t) =>
84 (L'.TFun (mt env dtmap t, (L'.TFfi ("Basis", "string"), loc)), loc) 87 (L'.TFun (mt env dtmap t, (L'.TFfi ("Basis", "string"), loc)), loc)
85 88
86 | L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "xml"), _), _), _), _), _), _) => 89 | L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "xml"), _), _), _), _), _), _) =>
87 (L'.TFfi ("Basis", "string"), loc) 90 (L'.TFfi ("Basis", "string"), loc)
395 case p of 398 case p of
396 L.PWild => (L'.PWild, loc) 399 L.PWild => (L'.PWild, loc)
397 | L.PVar (x, t) => (L'.PVar (x, monoType env t), loc) 400 | L.PVar (x, t) => (L'.PVar (x, monoType env t), loc)
398 | L.PPrim p => (L'.PPrim p, loc) 401 | L.PPrim p => (L'.PPrim p, loc)
399 | L.PCon (dk, pc, [], po) => (L'.PCon (dk, monoPatCon env pc, Option.map (monoPat env) po), loc) 402 | L.PCon (dk, pc, [], po) => (L'.PCon (dk, monoPatCon env pc, Option.map (monoPat env) po), loc)
403 | L.PCon (L.Option, _, [t], NONE) => (L'.PNone (monoType env t), loc)
404 | L.PCon (L.Option, _, [t], SOME p) => (L'.PSome (monoType env t, monoPat env p), loc)
400 | L.PCon _ => poly () 405 | L.PCon _ => poly ()
401 | L.PRecord xps => (L'.PRecord (map (fn (x, p, t) => (x, monoPat env p, monoType env t)) xps), loc) 406 | L.PRecord xps => (L'.PRecord (map (fn (x, p, t) => (x, monoPat env p, monoType env t)) xps), loc)
402 end 407 end
403 408
404 fun strcat loc es = 409 fun strcat loc es =