Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
pakcs
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • curry
  • pakcs
  • Issues
  • #22

Closed
Open
Opened Oct 08, 2019 by Kai Prott@kaiprottDeveloper

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.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: curry/pakcs#22