Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
C
curry-frontend
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • curry
  • curry-frontend
  • Merge Requests
  • !14

Merged
Opened May 19, 2019 by Jan-Hendrik Matthes@stu113804😄Developer13 of 13 tasks completed13/13 tasks

Add support for higher-rank polymorphism

  • Overview 2
  • Commits 137
  • Changes 63

This merge request adds support for higher-rank polymorphism to the frontend.

The extension of the existing type system is based on the paper Practical type inference for arbitrary-rank types also implemented by Haskell. The new type system is still predicative. An instantiation of type variables with higher-rank types is not allowed. But Curry programmers use the ($)-operator so much, to avoid writing parentheses, that the extended type inference has an ad-hoc special case for x $ y (just like Haskell) that allows it to do type inference for x $ y, even when impredicative polymorphism is needed.

Depends on curry-base!9 (merged)

Work that needs to be done:

  • Convert forall types to AbstractCurry
  • Add RankNTypes to the known language extensions of the frontend
  • Convert the TypeScheme data type into a forall type
  • Allow type constraints nested within type expressions
  • Implement the new typing rules
  • Adapt the checks and transformations
  • Detect impredicative polymorphism
  • Correct typing of higher-rank functions with predicates
  • Add tests for RankNTypes to the test suite

Bugs that need to be fixed:

  • Prelude.!!: index too large (#40 (closed))
  • Compilation error (#42 (closed))
  • Problems with additional constraints for functions inside InstanceDecls (#46 (closed))
  • Subsumption is not working correctly (#48 (closed))
Edited Nov 01, 2019 by Jan-Hendrik Matthes
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: curry/curry-frontend!14
Source branch: higher-rank-polymorphism