oke,
I try it with this :
acc :: a -> Maybe a -> Maybe a
acc a acc = if null a then Nothing else if (null (tail a)) then
(Just acc) else acc a acc
If a = null so a empty input then the output = Nothing
else
if the tail a is empty so there is only 1 item then the output
must be acc
else
must be run again ( there is a list with more then 1 item)
but now I see this error message :
Couldn't match expected type ‘a
-> Maybe a -> Maybe a’ with actual type ‘Maybe a’
Relevant bindings include acc :: Maybe a
and that is on the else part
Roelof
Benjamin Edwards schreef op 10-11-2014 18:07: