Commit 6a40aaf3 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Remove error message for newtypes since the type definition itself is present...

Remove error message for newtypes since the type definition itself is present after newtype elimination
parent 42536874
......@@ -5,7 +5,7 @@
--- constructor ordering of the corresponding data definitions.
---
--- @author Michael Hanus
--- @version November 2020
--- @version March 2021
------------------------------------------------------------------------------
module FlatCurry.CaseCompletion where
......@@ -112,10 +112,10 @@ unionMap f = foldr union [] . map f
dataDeclsOf :: Prog -> [DataDecl]
dataDeclsOf (Prog _ _ tdecls _ _) = concatMap dataDeclsOfTypeDecl tdecls
where
dataDeclsOfTypeDecl (TypeSyn _ _ _ _) = []
dataDeclsOfTypeDecl (TypeNew _ _ _ _) =
error $ "FlatCurry.CaseCompletion: newtype occurred!" -- TODO!
dataDeclsOfTypeDecl (Type tn _ _ cdecl) =
dataDeclsOfTypeDecl (TypeSyn _ _ _ _ ) = []
dataDeclsOfTypeDecl (TypeNew tn _ _ (NewCons cn _ _)) =
[(tn, [(cn,1)])] -- should not be relevant since newtypes are eliminated
dataDeclsOfTypeDecl (Type tn _ _ cdecl ) =
[(tn, map (\ (Cons cn ar _ _) -> (cn,ar)) cdecl)]
------------------------------------------------------------------------------
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