3 ms·
Not necessarily. You can define functions in GHCi using let. $ ghci Prelude> let fact x = if x == 0 then 1 else x * fact (x - 1) Prelude> fact 6 720
by jstepien 15y ago
Not necessarily. You can define functions in GHCi using let.
$ ghci
Prelude> let fact x = if x == 0 then 1 else x * fact (x - 1)
Prelude> fact 6
720