[Haskell-cafe] First steps in Haskell

Ketil Malde ketil.malde at bccs.uib.no
Tue Dec 20 17:09:48 EST 2005


Chris Kuklewicz <chris at mightyreason.com> writes:

> Prelude> let { fac :: Integer -> Integer; fac 0 = 1; fac n | n > 0 = n * fac (n-1) }

As somebody made me aware just the other day, the bracer are only
necessary for nested expressions.  So you can just use ; for line
breaks: 

Prelude> let fac :: Integer -> Integer; fac 0 = 1; fac n | n > 0 = n * fac (n-1)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Haskell-Cafe mailing list