diff --git a/004_type_systems.md b/004_type_systems.md index 4e5ca15..fc26584 100644 --- a/004_type_systems.md +++ b/004_type_systems.md @@ -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 @@ -484,7 +484,7 @@ We can consider a very simple type system for our language that will consist of $$ \begin{aligned} \tau :=\ & \t{Int} \\ - & \t{Bool} \\ + & \t{Bool} \\ & \tau \rightarrow \tau \\ \end{aligned} $$ diff --git a/chapter5/calc_typed/Check.hs b/chapter5/calc_typed/Check.hs index f053b59..30273c8 100644 --- a/chapter5/calc_typed/Check.hs +++ b/chapter5/calc_typed/Check.hs @@ -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