I mean, I get how String
and String2
differ: the latter seems to be data-first while the first one isn’t. But why have the non-data-first version at all if data-first is the recommended style and the String functions bind to the String.prototype
methods?
Isn’t code like files->Js.Array2.joinWith("\n\n")->Js.String2.splitByRe([%bs.re "/\\n{2,}/g"])
more convenient than, I don’t know, files->Js.Array.joinWith("\n\n", _)->Js.String2.splitByRe([%bs.re "/\\n{2,}/g"], _)
(or having to mix fast and slow pipes in the same expression)? To say nothing of the increased cognitive load and the maintenance burden.