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

Add a primitive Let that is compiled to let in Haskell #252

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jespercockx
Copy link
Member

No description provided.

@jespercockx jespercockx added this to the 1.3 milestone Dec 11, 2023
@flupe
Copy link
Contributor

flupe commented Dec 13, 2023

May I suggest having a cursed syntax:

infixr 5 Let
syntax Let a (λ x  b) = let[ x  a ] b

t : Bool
t =
  let[ x  True  ]
  let[ y  False ]
  x || y

@flupe
Copy link
Contributor

flupe commented Dec 13, 2023

Note: Haskell's let bindings are always recursive, so we should make sure that the name used in the Let does not appear in the expression being bound to prevent incorrect behavior.

@jespercockx jespercockx modified the milestones: 1.3, 1.4 Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants