[Haskell-beginners] Offside rule for function arguments?

Brent Yorgey byorgey at seas.upenn.edu
Mon Aug 23 05:15:25 EDT 2010


On Mon, Aug 23, 2010 at 09:33:13AM +0300, John Smith wrote:
> Why doesn't Haskell allow something like this?
> 
> fac 0 = 0
>     1 = 1
>     x = x * fac (x-1)
> 
> This would be clearer than repeating the function name each time,
> and follow the same pattern as guards and case.

Good question.  I don't know of any particular reason.

-Brent


More information about the Beginners mailing list