19 Dec 22:41
Re: Knowledge
Neil Mitchell <ndmitchell <at> gmail.com>
2007-12-19 21:41:56 GMT
2007-12-19 21:41:56 GMT
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
RSS Feed