FYI, this isn't one I feel super-strongly about, and I'm not particularly keen on *writing* the function, so if people don't want it I'll back off pronto.
My concern is for what happens when such rules don't fire. If someone converts a large list to a sequence only to reverse it, then the badly-ordered sequence will end up being evacuated by the garbage collector unnecessarily, pushing up the next major collection.
In contrast, I've used rewrite rules to fuse map with reverse; the worst case there is some extra churn in the nursery.
That said, if others don't consider it important enough, or have enough faith that rules will fire in this case (which may very well be), I can go the rules route.
On Sep 1, 2016 3:51 PM, "John Wiegley" <johnw@newartisans.com> wrote:>>>>> "DF" == David Feuer <david.feuer@gmail.com> writes:
FD> I'd like to add a function
DF> fromListReversing :: [a] -> Seq a
Hi David,
Perhaps rather than proliferating the libraries with fused compositions that
are faster than their composites via (.), we could defer things like this to
REWRITE rules.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2