Move newtype-transformation to pakcs
We'd like to keep newtypes intact during translation to FlatCurry, because they will be needed in KICS2. Thus, FlatCurry will be changed to include newtype declarations and functions will still contain references to newtype constructors. New FlatCurry datatype representation:
data TypeDecl
= Type QName Visibility [TVarIndex] [ConsDecl]
| TypeSyn QName Visibility [TVarIndex] TypeExpr
| TypeNew QName Visibility [TVarIndex] NewConsDecl -- <---------- added
deriving (Eq, Read, Show)
-- |A constructor declaration for a newtype consists
-- of the name of the constructor
-- and the argument type of the constructor.
data NewConsDecl = NewCons QName Visibility TypeExpr -- <---------- added
deriving (Eq, Read, Show)
Some additional notes:
- With the version3-branch, the curry frontend can output this new FlatCurry when
-O no-desugar-newtypes
is used as a command line option. - Due to recent changes, on the newest version of this branch, stack is needed to compile the frontend, but one could use an older commit.