Lambda requires at least one parameter [GHC-71614]
The parameter list of a lambda expression \param_1 ... param_n -> ...
cannot be empty.
A lambda expression of the form \ -> ...
causes this error.
Examples
Empty parameter list in lambda
The parameter list of a lambda expression must contain at least one parameter, but here it is empty.
Error Message
LambdaNoParams.hs:3:7: error: [GHC-71614]
A lambda requires at least one parameter
|
3 | lam = \ -> 0
| ^^^^^^
LambdaNoParams.hs
Before
module LambdaNoParams where
lam = \ -> 0
After
module LambdaNoParams where
lam = \x -> 0