[Haskell-cafe] trivial function application question

J. Garrett Morris trevion at gmail.com
Fri Jan 5 02:53:28 EST 2007


Oops, I seem not to have proofread my message.

On 1/4/07, J. Garrett Morris <trevion at gmail.com> wrote:
> On 1/4/07, brad clawsie <clawsie at fastmail.fm> wrote:
> > s = "abcdefg"
> > patterns = ["a","b"]
> > replacements = ["Z","Y"]

I changed the name here so as not to conflict with the replace function.

<snip>

> You can create the replacing functions using zipWith :: (a -> b -> c)
> -> [a] -> [b] -> [c] (from the Prelude) as follows:
>
> replacers = zipWith replace patterns replacements

This line was previously incorrect.

 /g


More information about the Haskell-Cafe mailing list