2007/7/20, Bulat Ziganshin <[EMAIL PROTECTED]>:
> allEqual [] = True
> allEqual (x:xs) = all (== x) xs

> with the same caveat about allEqual [] as in your case.

allEqual xs  =  all (== head xs) xs

Riiiight. Not evaluated in the edge case, because xs is empty. Didn't
think of that, nice :-)

- Benja
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to