_ just means "ignore this parameter, I'm not going to use it"
On Tuesday, November 11, 2014, Roelof Wobben <r.wobben@home.nl> wrote:
Thanks, this is working well.
But just for understanding
in the part acc x Nothing x is the input string,
and in the part _j means the same as (xs:x)
Roelof
Alex Hammel schreef op 10-11-2014 22:47:
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@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@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners