[Haskell-beginners] Are these soloutions all valid and a good use of Haskell

Alex Hammel ahammel87 at gmail.com
Mon Nov 10 21:47:05 UTC 2014


It's an indentation issue. Make sure that there are no spaces before the
bit about 'last5 = foldr acc' etc.

On Mon, Nov 10, 2014 at 12:48 PM, Roelof Wobben <r.wobben at home.nl> wrote:

> Roelof Wobben schreef op 10-11-2014 20:59:
>
>> last5 :: [a] -> Maybe a
>>    last5 = foldr acc Nothing where
>>        acc x Nothing  = Just x
>>        acc _ j        = j
>>
>
> When I enter this in GHCI  I see this error :
>
> Illegal type signature: ‘[a] -> Maybe a last5’
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141110/828046f0/attachment.html>


More information about the Beginners mailing list