pakcs issueshttps://git.ps.informatik.uni-kiel.de/curry/pakcs/-/issues2021-03-08T21:00:39Zhttps://git.ps.informatik.uni-kiel.de/curry/pakcs/-/issues/22Move newtype-transformation to pakcs2021-03-08T21:00:39ZKai ProttMove newtype-transformation to pakcsWe'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....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:
``` haskell
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](stack) is needed to compile the frontend, but one could use an older commit.Michael HanusMichael Hanus