Discussion: name for reversing fromList in Data.Sequence

I'd like to add a function fromListReversing :: [a] -> Seq a to Data.Sequence, with fromListReversing = reverse . fromList = fromList . reverse I don't know just what to call this function, however.

"DF" == David Feuer
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

On Thu, Sep 1, 2016 at 12:51 PM, John Wiegley
"DF" == David Feuer
writes: DF> 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.
Supposing we do have the rewrite rules, what exactly are we going to rewrite them *to*? the fused function still needs a name... And, as David mentions, there's the fragility problem: so even if users by and large rely on the rewrite rules, it's still nice to be able to directly invoke the fused version if desired. Usually for this sort of thing I like to define the fused function, perhaps only exported from an Foo.Internal module, and then use rules to rewrite things into the fused form. -- Live well, ~wren
participants (3)
-
David Feuer
-
John Wiegley
-
wren romano