mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-08-16 15:11:06 +03:00
Merge pull request #86 from VitorCBSB/master
Chapter 5: Fixed Type Mismatch message for If.
This commit is contained in:
commit
5c515bd386
@ -404,7 +404,7 @@ typeof expr = case expr of
|
||||
then throwError $ TypeMismatch ta TBool
|
||||
else
|
||||
if tb /= tc
|
||||
then throwError $ TypeMismatch ta tb
|
||||
then throwError $ TypeMismatch tb tc
|
||||
else return tc
|
||||
|
||||
Tr -> return TBool
|
||||
|
@ -48,7 +48,7 @@ typeof expr = case expr of
|
||||
then throwError $ TypeMismatch ta TBool
|
||||
else
|
||||
if tb /= tc
|
||||
then throwError $ TypeMismatch ta tb
|
||||
then throwError $ TypeMismatch tb tc
|
||||
else return tc
|
||||
|
||||
check :: Expr -> Either TypeError Type
|
||||
|
Loading…
Reference in New Issue
Block a user