On Wednesday 19 September 2007, C.M.Brown wrote:

> g is strict in its first argument. Declared in a let it would look like:
>
> f x = let g x = case x of
>                    (Just y) -> y
>                    Nothing -> error "Nothing"  in g x
>
> Again, g must be strict in its first argument.

Actually,

f x = let g (Just x) = x
          g Nothing  = error "Nothing" in g x

is a valid definition. A let expression can have multiple definitions just 
like a where clause.

-- Dan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to