
18 Sep
2006
18 Sep
'06
7:22 a.m.
On Mon, Sep 18, 2006 at 04:16:55AM -0700, Carajillu wrote:
Wow! I'm starting to love this languaje, and the people who uses it!:)
You spoke too early. My code had a bug, a huge one... this is the right one: -- Replaces a wildcard in a list with the list given as the third argument substitute :: Eq a => a -> [a] -> [a] -> [a] substitute e l1 l2= [c | c <- check_elem l1] where check_elem [] = l1 check_elem (x:xs) = if x == e then (l2 ++ xs) else [x] ++ check_elem xs Ciao, Andrea