From 1252cc77514e8c485396680827bf52c517be7cdd Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 22 Dec 2023 18:32:08 +0000 Subject: Simplify --- src/Micro/Ast.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Micro/Ast.hs b/src/Micro/Ast.hs index ec9141e..d84eda6 100644 --- a/src/Micro/Ast.hs +++ b/src/Micro/Ast.hs @@ -10,9 +10,7 @@ data Type = Type String | FuncType [Type] (Maybe Type) deriving (Eq, Ord) instance Show Type where show (Type t) = t show (FuncType params rtyp) = - "(" ++ (intercalate ", " (fmap show params)) ++ ") -> " ++ case rtyp of - Just t -> show t - Nothing -> "()" + "(" ++ intercalate ", " (fmap show params) ++ ") -> " ++ maybe "()" show rtyp showList :: [Type] -> String showList xs = intercalate ", " $ fmap show xs @@ -42,5 +40,4 @@ data Op deriving (Eq, Ord, Show) toFuncType :: [FuncParam] -> Maybe Type -> Type -toFuncType params rtyp = - FuncType (map (\(_, t, _, _) -> t) params) rtyp +toFuncType params = FuncType (map (\(_, t, _, _) -> t) params) -- cgit v1.2.3