[Haskell-cafe] Problems interpreting
crespi.albert at gmail.com
Mon Sep 18 08:42:47 EDT 2006
Not a good solution, it just substitutes the first occurrence of the item in
the list. I'll try the others
> Finally I took Andrea's solution "check_elem (x:xs) = if x == e then (l2
> ++ xs) else [x] ++ check_elem xs"
> I think it's easy to understand for me ( in my noob level), than the
> recursive one.
> I'm testing it and it's working really well. The other solutions are a
> little complicated for me, but I'm still trying to undestand them.
> Andrea Rossato wrote:
>> On Mon, Sep 18, 2006 at 12:25:21PM +0100, Neil Mitchell wrote:
>>> Why not:
>>> > check_elem (x:xs) = if x == e then (l2 ++ xs) else x : check_elem xs
>> Thank you!
>> Lists are my personal nightmare...;-)
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
View this message in context: http://www.nabble.com/Problems-interpreting-tf2290155.html#a6362912
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe