[Haskell-cafe] Can I check the length in a guarded expresion

Francesco Ariis fa-ml at ariis.it
Sun Nov 9 18:40:40 UTC 2014


On Sun, Nov 09, 2014 at 07:33:09PM +0100, Roelof Wobben wrote:
> Hello,
>
> I try to make a guarded solution to find the last item in a list.
>
> I thought I could do something like this
>
> | length a == 1 = a

^-- this is valid Haskell.

> But then I see a lot of error messages.

You should paste a complete example or the error or both, so
people can easily see what went wrong with your code
-F


More information about the Haskell-Cafe mailing list