Replacing items in a list
Your code is not a replacement for replace (pun intended).  Its type signature is wrong.  Your code has type Eq b =&gt; b -&gt; b -&gt; [b] -&gt; [b], but replace should have type Eq a =&gt; [a] -&gt; [a] -&gt; [a] -&gt; [a].

&lt;$&gt; and &lt;*&gt; are infix, not prefix.

I'd prefer this to your implementation:

replace' :: Eq b =&gt; b -&gt; b -&gt; [b] -&gt; [b]
replace' a b = map (\x -&gt; if (a == x) then b else x)


It does the exact same thing in the exact same way, but is simpler and more readable (even a novice Haskell programmer who has never heard of bool or &lt;$&gt; or &lt;*&gt; can read it).  Even more important: it has a type signature.  

If you'd decided to cut-and-paste the type signature of the function you wanted to replicate before starting, you would have found out that your version doesn't work as a replacement at compile time -- and if you'd looked at and thought about the type signature, you probably would have wondered why the extra []s were there, and figured it out even earlier.