small changes

This commit is contained in:
Radu Macocian
2022-07-27 17:51:08 +03:00
parent 3d14257870
commit 18b7e778a2
3 changed files with 9 additions and 11 deletions

View File

@@ -41,5 +41,3 @@ printDisplayName enumName (MakeEnumValue name _ (Just display)) =
"show" <+> pretty enumName <> pretty name <+> "= \"" <> pretty display <> "\"" "show" <+> pretty enumName <> pretty name <+> "= \"" <> pretty display <> "\""
printDisplayName enumName (MakeEnumValue name _ Nothing) = printDisplayName enumName (MakeEnumValue name _ Nothing) =
"show" <+> pretty enumName <> pretty name <+> "= \"" <> pretty name <> "\"" "show" <+> pretty enumName <> pretty name <+> "= \"" <> pretty name <> "\""

View File

@@ -266,7 +266,7 @@ checkFunctionCall [] fun args = Left $ UndefinedFunction $ "Undefined function:
checkFunctionCall ((Func n a r):symbolMap) name args checkFunctionCall ((Func n a r):symbolMap) name args
| not $ null $ lefts args = Left $ ErrorInsideFunction (name ++ ": " ++ show (lefts args)) | not $ null $ lefts args = Left $ ErrorInsideFunction (name ++ ": " ++ show (lefts args))
| name == n = if all isRight coerce then Right $ ExplicitFunction name (zip (rights args) (rights coerce)) (MakeCoercion [MakeIdCoercion (fst r)] (MakeCardinalityIdCoercion (snd r))) | name == n = if all isRight coerce then Right $ ExplicitFunction name (zip (rights args) (rights coerce)) (MakeCoercion [MakeIdCoercion (fst r)] (MakeCardinalityIdCoercion (snd r)))
else checkFunctionCall symbolMap name args--Left $ UndefinedFunction $ "Undefined function: " ++ name ++ " [" ++ show (rights args) ++ "]" else checkFunctionCall symbolMap name args
| otherwise = checkFunctionCall symbolMap name args | otherwise = checkFunctionCall symbolMap name args
where where
argCoerce = map returnCoercion (rights args) argCoerce = map returnCoercion (rights args)