lamda notation haskell code example
Example: haskell lambda
-- directly apply to the lambda function in GHCI:
(\x -> x + 1) 4
>> 5 :: Integer
-- giving name to a lambda function:
addOne = \x -> x + 1
-- directly apply to the lambda function in GHCI:
(\x -> x + 1) 4
>> 5 :: Integer
-- giving name to a lambda function:
addOne = \x -> x + 1