
15 Oct
2003
15 Oct
'03
1:38 a.m.
Scott Turner writes: : | Alternatively, since nextSame1 is called only in the context where | the expected value is known, you could give it the expected value | as another parameter. Then it would be possible to sometimes avoid | referencing the right operand at all. It would be called | foldr (nextSame1 a) (Just a) as Once you do that, you can simplify the result type of the fold, from 'Maybe a' to Bool. allSame [] = True allSame (a:as) = all (a==) as