agda2hs
agda2hs copied to clipboard
Add a primitive `Let` that is compiled to `let` in Haskell
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
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.