> replace :: Text-> Text -> Text-> Text
>
>
> Which argument is the text to replace, which is the replacement and
> which is the text that should be scanned?Considering partial application, the order that makes the most sense is
- what to look for
- what to replace it with
- the big string to search and replace in
> Imagine a generalized version of replace that 1) works on streams, and
> 2) allows replacing a sequence of texts (like, say, chapter headers)
> instead of replacing the same text repeatedly. It could have the
> following signature:
>
> replace' :: Stream (Stream (Of Text) m) m ()
> -> Stream (Stream (Of Text) m) m Void
> -> Stream (Of Text) m r
> -> Stream (Of Text) m r
>
>
> Do you find easy to intuit, just by looking at that signature, which
> is the function of each argument?Absolutely not. In fact, this crossed my personal complexity horizon
and is still accelerating towards some kind of singularity.
The more I try to imagine a problem that this might be a solution to,
the less I can understand why it would be approached this way.