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

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to