[Haskell-cafe] Producing MinimumValue

Jonathan Cast jcast at ou.edu
Thu Jul 19 15:34:06 EDT 2007


On Thursday 19 July 2007, Alexteslin wrote:
> I have defined the first line it seems right to me but second line not
> sure. I have True or False and whatever value i give it produces that
> value.
>
> allEqual :: [Int] -> Bool
> allEqual (x1:x2:xs) = (x1 == x2) && allEqual xs
> allEqual _          = ???

Try defining just

allEqual [x1, x2, x3]

and then generalize that.

Jonathan Cast
http://sourceforge.net/projects/fid-core
http://sourceforge.net/projects/fid-emacs


More information about the Haskell-Cafe mailing list