# 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

    31x
    31x

    159x
    159x
    116x

    159x
    6x
    9x

    159x
    159x
    159x
    159x
    159x
    159x

    79x
    79x

    79x

    79x
    79x
    79x
    79x
    79x
    79x

    79x
    79x

    31x
    31x

     '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, ma, f);
      };
      var flatten = function (mma) {
        return Curry._2(M.flat_map, mma, (function (v) {
                      return v;
                    }));
      };
      var composeKleisli = BsMonadExtensions.compose_kliesli;
      var flipComposeKleisli = BsMonadExtensions.compose_kliesli_flipped;
      var liftM1 = BsMonadExtensions.liftM1;
      var when_ = BsMonadExtensions.when_;
      var unless = BsMonadExtensions.unless;
      return {
              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, ma, f);
      };
      var flatten = function (mma) {
        return Curry._2(M.flat_map, mma, (function (v) {
                      return v;
                    }));
      };
      var composeKleisli = BsMonadExtensions.compose_kliesli;
      var flipComposeKleisli = BsMonadExtensions.compose_kliesli_flipped;
      var liftM1 = BsMonadExtensions.liftM1;
      var when_ = BsMonadExtensions.when_;
      var unless = BsMonadExtensions.unless;
      var MonadExtensions = {
        BsMonadExtensions: BsMonadExtensions,
        flatMap: flatMap,
        flatten: flatten,
        composeKleisli: composeKleisli,
        flipComposeKleisli: flipComposeKleisli,
        liftM1: liftM1,
        when_: when_,
        unless: unless
      };
      var $great$great$eq = M.flat_map;
      return {
              MonadExtensions: MonadExtensions,
              $great$great$eq: $great$great$eq,
              $eq$less$less: flatMap,
              $great$eq$great: composeKleisli,
              $less$eq$less: flipComposeKleisli
            };
    }

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