Mercurial > urweb
comparison src/elab_err.sml @ 711:7292bcb7c02d
Made type class system very general; demo compiles
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 09 Apr 2009 12:31:56 -0400 |
parents | 1fb318c17546 |
children | 915ec60592d4 |
comparison
equal
deleted
inserted
replaced
710:71409a4ccb67 | 711:7292bcb7c02d |
---|---|
215 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context"; | 215 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context"; |
216 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e), | 216 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e), |
217 ("Type", p_con env c)]) co) | 217 ("Type", p_con env c)]) co) |
218 | Unresolvable (loc, c) => | 218 | Unresolvable (loc, c) => |
219 (ErrorMsg.errorAt loc "Can't resolve type class instance"; | 219 (ErrorMsg.errorAt loc "Can't resolve type class instance"; |
220 eprefaces' [("Class constraint", p_con env c)]) | 220 eprefaces' [("Class constraint", p_con env c), |
221 ("Class database", p_list (fn (c, rules) => | |
222 box [P.p_con env c, | |
223 PD.string ":", | |
224 space, | |
225 p_list (fn (c, e) => | |
226 box [p_exp env e, | |
227 PD.string ":", | |
228 space, | |
229 P.p_con env c]) rules]) | |
230 (E.listClasses env))]) | |
221 | IllegalRec (x, e) => | 231 | IllegalRec (x, e) => |
222 (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)"; | 232 (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)"; |
223 eprefaces' [("Variable", PD.string x), | 233 eprefaces' [("Variable", PD.string x), |
224 ("Expression", p_exp env e)]) | 234 ("Expression", p_exp env e)]) |
225 | 235 |