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

Roelof Wobben r.wobben at home.nl
Sun Nov 9 18:33:09 UTC 2014


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

But then I see a lot of error messages.

Is there another way I can check the length of a list with guards ?

Roelof



More information about the Haskell-Cafe mailing list