Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • C curry-frontend
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 70
    • Issues 70
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • curry
  • curry-frontend
  • Merge requests
  • !14

Add support for higher-rank polymorphism

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jan-Hendrik Matthes requested to merge higher-rank-polymorphism into master May 19, 2019
  • Overview 2
  • Commits 137
  • Pipelines 0
  • 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
Reviewers
Request review from
Time tracking
Source branch: higher-rank-polymorphism