Thread overview
[Issue 6484] compose can't take multi arg functions
Jun 06, 2014
Justin Whear
Oct 28, 2020
Paul Backus
Oct 29, 2020
Dlang Bot
Oct 29, 2020
Dlang Bot
June 06, 2014
https://issues.dlang.org/show_bug.cgi?id=6484

Justin Whear <justin@economicmodeling.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |justin@economicmodeling.com

--- Comment #3 from Justin Whear <justin@economicmodeling.com> ---
Kenji's made some recent changes to compose and I cannot reproduce in 2.065.

int f(int a){ return a; }
int g(int a){ return a; }
int h(int a,int b,int c){ return a * b * c; }

import std.functional;
alias compose!(f,g,h) F;
static assert(F(1,2,3) == f(g(h(1,2,3))));

--
October 28, 2020
https://issues.dlang.org/show_bug.cgi?id=6484

Paul Backus <snarwin+bugzilla@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla@gmail.com

--- Comment #4 from Paul Backus <snarwin+bugzilla@gmail.com> ---
This bug still exists in 2.094.0. The example in comment 3 fails to compile, with the following output:

---
bug.d(7): Error: template `std.functional.compose!(f, compose).compose` cannot
deduce function from argument types `!()(int, int, int)`, candidates are:
/usr/include/dmd/phobos/std/functional.d(1161):        `compose(E)(E a)`
bug.d(7):        while evaluating: `static assert(compose(E)(E a)(1, 2, 3) ==
f(g(h(1, 2, 3))))`
---

--
October 29, 2020
https://issues.dlang.org/show_bug.cgi?id=6484

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@pbackus created dlang/phobos pull request #7685 "Fix issue 6484 - compose can't take multi arg functions" fixing this issue:

- Fix issue 6484 - compose can't take multi arg functions

https://github.com/dlang/phobos/pull/7685

--
October 29, 2020
https://issues.dlang.org/show_bug.cgi?id=6484

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #7685 "Fix issue 6484 - compose can't take multi arg functions" was merged into master:

- 4083852b4b3637595d1a35eb85fc97b7dcc6ced0 by Paul Backus:
  Fix issue 6484 - compose can't take multi arg functions

https://github.com/dlang/phobos/pull/7685

--