[Haskell-cafe] Problem in code

Neil Mitchell ndmitchell at gmail.com
Tue Jun 6 10:55:58 EDT 2006


Hi,

Haskell is based on indentation for grouping, so your code is fine,
you just need to indent the lines marked:

> f :: (Float,Float) -> Float
> f (x,y) = (a(x,y) + 4) * (b(x,y) + 3)
>     where
>     a :: (Float,Float) -> Float
>     a(x,y) = (x + y)*2
>     b :: (Float,Float) -> Float
>     b(x,y) = (y - x)*5

You can do it with let, but there is no need.

Thanks

Neil


More information about the Haskell-Cafe mailing list