1
0
forked from GitHub/gf-core

Introduce an explicit error value in the Term type

This makes it easier to treat run-time errors (e.g. caused by calls to
Predef.error) in a way that is more typical for a lazy functional language.
This commit is contained in:
hallgren
2011-10-20 14:36:30 +00:00
parent e5accc0d8d
commit ed451653bd
4 changed files with 28 additions and 8 deletions

View File

@@ -192,6 +192,7 @@ ppTerm q d (Typed e t) = char '<' <> ppTerm q 0 e <+> colon <+> ppTerm q 0 t <>
ppTerm q d (ImplArg e) = braces (ppTerm q 0 e)
ppTerm q d (ELincat cat t) = prec d 4 (text "lincat" <+> ppIdent cat <+> ppTerm q 5 t)
ppTerm q d (ELin cat t) = prec d 4 (text "lin" <+> ppIdent cat <+> ppTerm q 5 t)
ppTerm q d (Error s) = prec d 4 (text "Predef.error" <+> str s)
ppEquation q (ps,e) = hcat (map (ppPatt q 2) ps) <+> text "->" <+> ppTerm q 0 e