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

@@ -107,6 +107,7 @@ appPredefined t = case t of
(K s) | f == cIsUpper -> retb $ if (all isUpper s) then predefTrue else predefFalse
(K s) | f == cToUpper -> retb $ K $ map toUpper s
(K s) | f == cToLower -> retb $ K $ map toLower s
(K s) | f == cError -> retb $ Error s
_ -> retb t