# All files / src/extensions Relude_Extensions_Monad.bs.js

90% Statements 27/30
100% Branches 0/0
62.5% Functions 5/8
90% Lines 27/30

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71

    27x
    27x

    143x
    143x
    115x

    143x
    6x
    9x

    143x
    143x
    143x
    143x
    143x
    143x

    69x
    69x

    69x

    69x
    69x
    69x
    69x
    69x
    69x

    69x
    69x

    27x
    27x

     'use strict';

    var Curry = require("bs-platform/lib/js/curry.js");
    var Functions$BsAbstract = require("bs-abstract/lib/js/src/functions/Functions.bs.js");

    function MonadExtensions(M) {
      var BsMonadExtensions = Functions$BsAbstract.Monad(M);
      var flatMap = function (f, ma) {
        return Curry._2(M[/* flat_map */3], ma, f);
      };
      var flatten = function (mma) {
        return Curry._2(M[/* flat_map */3], mma, (function (v) {
                      return v;
                    }));
      };
      var composeKleisli = BsMonadExtensions[/* compose_kliesli */3];
      var flipComposeKleisli = BsMonadExtensions[/* compose_kliesli_flipped */4];
      var liftM1 = BsMonadExtensions[/* liftM1 */6];
      var when_ = BsMonadExtensions[/* when_ */8];
      var unless = BsMonadExtensions[/* unless */9];
      return /* module */[
              /* BsMonadExtensions */BsMonadExtensions,
              /* flatMap */flatMap,
              /* flatten */flatten,
              /* composeKleisli */composeKleisli,
              /* flipComposeKleisli */flipComposeKleisli,
              /* liftM1 */liftM1,
              /* when_ */when_,
              /* unless */unless
            ];
    }

    function MonadInfix(M) {
      var BsMonadExtensions = Functions$BsAbstract.Monad(M);
      var flatMap = function (f, ma) {
        return Curry._2(M[/* flat_map */3], ma, f);
      };
      var flatten = function (mma) {
        return Curry._2(M[/* flat_map */3], mma, (function (v) {
                      return v;
                    }));
      };
      var composeKleisli = BsMonadExtensions[/* compose_kliesli */3];
      var flipComposeKleisli = BsMonadExtensions[/* compose_kliesli_flipped */4];
      var liftM1 = BsMonadExtensions[/* liftM1 */6];
      var when_ = BsMonadExtensions[/* when_ */8];
      var unless = BsMonadExtensions[/* unless */9];
      var MonadExtensions = /* module */[
        /* BsMonadExtensions */BsMonadExtensions,
        /* flatMap */flatMap,
        /* flatten */flatten,
        /* composeKleisli */composeKleisli,
        /* flipComposeKleisli */flipComposeKleisli,
        /* liftM1 */liftM1,
        /* when_ */when_,
        /* unless */unless
      ];
      var $great$great$eq = M[/* flat_map */3];
      return /* module */[
              /* MonadExtensions */MonadExtensions,
              /* >>= */$great$great$eq,
              /* =<< */flatMap,
              /* >=> */composeKleisli,
              /* <=< */flipComposeKleisli
            ];
    }

    exports.MonadExtensions = MonadExtensions;
    exports.MonadInfix = MonadInfix;
    /* Functions-BsAbstract Not a pure module */