Mercurial > urweb
comparison src/elaborate.sml @ 564:803b2f3bb86b
Monad type class seems to be working
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Fri, 19 Dec 2008 10:27:58 -0500 |
parents | 44958d74c43f |
children | 7c3c21eb5b4c |
comparison
equal
deleted
inserted
replaced
563:44958d74c43f | 564:803b2f3bb86b |
---|---|
3546 (prefaces "Unresolved constraint in top.ur" | 3546 (prefaces "Unresolved constraint in top.ur" |
3547 [("loc", PD.string (ErrorMsg.spanToString loc)), | 3547 [("loc", PD.string (ErrorMsg.spanToString loc)), |
3548 ("c1", p_con env c1), | 3548 ("c1", p_con env c1), |
3549 ("c2", p_con env c2)]; | 3549 ("c2", p_con env c2)]; |
3550 raise Fail "Unresolved constraint in top.ur")) | 3550 raise Fail "Unresolved constraint in top.ur")) |
3551 | TypeClass _ => raise Fail "Unresolved type class constraint in top.ur") gs | 3551 | TypeClass (env, c, r, loc) => |
3552 let | |
3553 val c = normClassKey env c | |
3554 in | |
3555 case E.resolveClass env c of | |
3556 SOME e => r := SOME e | |
3557 | NONE => expError env (Unresolvable (loc, c)) | |
3558 end) gs | |
3559 | |
3552 val () = subSgn (env', D.empty) topSgn' topSgn | 3560 val () = subSgn (env', D.empty) topSgn' topSgn |
3553 | 3561 |
3554 val (env', top_n) = E.pushStrNamed env' "Top" topSgn | 3562 val (env', top_n) = E.pushStrNamed env' "Top" topSgn |
3555 | 3563 |
3556 val (ds', (env', _)) = dopen (env', D.empty) {str = top_n, strs = [], sgn = topSgn} | 3564 val (ds', (env', _)) = dopen (env', D.empty) {str = top_n, strs = [], sgn = topSgn} |