[Issue 8755] Change the order of reduce arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 24 21:23:21 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=8755


Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu


--- Comment #7 from Martin Nowak <code at dawg.eu> 2014-01-24 21:23:16 PST ---
Haskell has a function call flip for this.
http://hackage.haskell.org/package/base-4.6.0.1/docs/Prelude.html#v:flip

It turns a function taking (a, b) into one taking (b, a) instead.

In phobos this is called binaryReverseArgs.
http://dlang.org/phobos/std_functional.html#.binaryReverseArgs

So one can use
    rng.binaryReverseArgs!(reduce!fun)(seed);

Maybe we could rename it to flipArgs to make it useable?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list