Hi

> > contains :: Eq a => [a]->a->Bool
> > contains [] e = False
> > contains (x:xs) e = if x==e then True else contains xs e
>
> contains = flip elem

And even if not using the elem function, the expression:

if x==e then True else contains xs e

can be written as:

x==e || contains xs e

Thanks

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

Reply via email to