writeln, UFCS and flip

Timon Gehr timon.gehr at gmx.ch
Fri Apr 26 13:24:09 PDT 2013


On 04/26/2013 10:15 PM, bearophile wrote:
> Tyro[17]:
>
>> > While flip2 does:
>> >
>> > flip2!foo(a, b, c) === foo(b, a, c)
>> > flip2!foo(a, b, c, d) === foo(b, a, c, d)
>>
>> and this rotate....
>
> Really? Just swapping the first two arguments and leaving the others at
> their place is for a "rotate"?
>
>
>> Why flip in the first place?
>
> I don't know, it's the name used in the Haskell Prelude.
>

And there it flips the first two arguments (of a curried function, since 
this is the standard for Haskell).



More information about the Digitalmars-d-learn mailing list