Question: Haskell function that will replace all occurrences of a in list with b. Write the function replace :: Eq a => a -> a ->
Haskell function that will replace all occurrences of a in list with b.
Write the function replace :: Eq a => a -> a -> [a] -> [a]. The application replace a b list will replace all occurrences of a in list with b.
For example:
replace a X "abcabAcdaee" ? "XbcXbAcdXee"
replace 1 100 [2,3,1,1,5,6] ? [2,3,100,100,5,6]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
