infix

Conveniently composes function with the This-Binding syntax.

Signature

infix(that)
(('b) => 'c) . (('a) => 'b) => (('a) => 'c)

Documentation

Conveniently composes function with the This-Binding syntax.

This is a free-method version of compose that applies the this argument first, then the function it takes as argument. It's meant to be used with the This-Binding Syntax proposal.

const then   = compose.infix;
const inc    = (x) => x + 1;
const double = (x) => x * 2;

inc::then(double)(2);  // ==> 6

Properties

Source Code

function(that) {
  return compose(that, this);
}
Stability
stable
Licence
MIT
Module
folktale/core/lambda/compose
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)