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 of it, no matter 
how deep it occurred in the list.
   
  Note:  Remember it says that "no matter how deep it occurred in the list.".It 
means thatwe may have nested list
   
  example: replace 1 2 [1 2 3 4] => [2 2 3 4]
  replace 1 2 [[1 2 3][3 4 5 1]]  => [[2 2 3][3 4 5 1]]

       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to