Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement polymorphic let bindings #157

Open
2 tasks
maclement opened this issue Jul 28, 2020 · 0 comments
Open
2 tasks

Implement polymorphic let bindings #157

maclement opened this issue Jul 28, 2020 · 0 comments
Labels
enhancement New feature or request IR Changes of the intermediate representation

Comments

@maclement
Copy link
Contributor

Description

Add type arguments to let bindings as shown below.

let l @a = length @a in l @Integer [1,2,3] + l @Bool [True,False]

Motivation

The current implementation does not infer the type of polymorphic let bindings correctly. These polymorphic let bindings are allowed in Haskell and are probably needed for the translation of guards. The following is allowed in Haskell for example.

let l = length in l [1,2,3] + l [True,False]

Tasks

  • Add type arguments to the Bind type.
  • Adjust TypeInferencePass for let expressions
@maclement maclement added enhancement New feature or request IR Changes of the intermediate representation labels Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request IR Changes of the intermediate representation
Projects
None yet
Development

No branches or pull requests

1 participant