[Haskell-cafe] replacement

2007-04-14 Thread hossein rohani
Write a function with three parameters, two atoms and a list, (say p1, p2 and L) that returns the list, L, with all occurrences of the first given atom, p1, replaced by the second one, p2. If P2 be nil, the given atom should be deleted and the returned list cannot contain anything in place

Re: [Haskell-cafe] replacement

2007-04-14 Thread Neil Mitchell
Hi Write a function with three parameters, two atoms and a list, (say p1, p2 and L) that returns the list, L, with all occurrences of the first given atom, p1, replaced by the second one, p2. If P2 be nil, the given atom should be deleted and the returned list cannot contain anything in place