UNPKG

@dillonkearns/elm-graphql

Version:

<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">

71 lines (58 loc) 1.11 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.inj = inj; exports.prj = prj; exports.runEff = runEff; exports.runPure = runPure; exports.map = map; exports.ap = ap; exports.of = of; exports.chain = chain; var _HKT = require('./HKT'); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var IsEff = function IsEff() { _classCallCheck(this, IsEff); }; function inj(a) { return a; } function prj(fa) { return fa; } function runEff(eff) { return prj(eff)(); } function runPure(pure) { return runEff(pure); } function map(f, fa) { return inj(function () { return f(runEff(fa)); }); } function ap(fab, fa) { return inj(function () { return runEff(fab)(runEff(fa)); }); } function of(a) { return inj(function () { return a; }); } function chain(f, fa) { return inj(function () { return runEff(f(runEff(fa))); }); } if (false) { // eslint-disable-line ({ map: map, ap: ap, of: of, chain: chain }); }