Commit 4e518c37 authored by André Pacak's avatar André Pacak

missed using partial order in sle vision example

parent 7ea6221e
......@@ -9,6 +9,7 @@ import GHC.Exts (Constraint)
import SLE_Vision_Example.Language
import Util.ErrorMessages
import Util.PartialOrd
data Typed a = Typed a | Error [String]
......@@ -52,7 +53,7 @@ matchFun AnyType _ = return (AnyType, AnyType)
matchFun ty err = fail [funError ty err]
matchType :: Type -> Type -> String -> Typed ()
matchType expected given _ | expected == given = return ()
matchType expected given _ | expected >= given = return ()
matchType ty1 ty2 err = fail [generalError (show ty1) ty2 err]
lookup :: Ctx -> Name -> Typed Type
......
......@@ -9,6 +9,7 @@ import GHC.Exts (Constraint)
import SLE_Vision_Example.Language
import Util.ErrorMessages
import Util.PartialOrd
-- is needed because we use the RebindableSyntax extension
ifThenElse :: Bool -> a -> a -> a
......@@ -57,7 +58,7 @@ matchFun AnyType _ = return (AnyType, AnyType)
matchFun ty err = fail [funError ty err]
matchType :: Type -> Type -> String -> Typed ()
matchType expected given _ | expected == given = return ()
matchType expected given _ | expected >= given = return ()
matchType ty1 ty2 err = fail [generalError (show ty1) ty2 err]
......
......@@ -9,6 +9,7 @@ import GHC.Exts (Constraint)
import SLE_Vision_Example.Language
import Util.ErrorMessages
import Util.PartialOrd
data Typed a = Typed a | Error [String]
......@@ -52,7 +53,7 @@ matchFun AnyType _ = return (AnyType, AnyType)
matchFun ty err = fail [funError ty err]
matchType :: Type -> Type -> String -> Typed ()
matchType expected given _ | expected == given = return ()
matchType expected given _ | expected >= given = return ()
matchType ty1 ty2 err = fail [generalError (show ty1) ty2 err]
lookup :: Ctx -> Name -> Typed Type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment