# All files / src Relude_OptionT.bs.js

91.53% Statements 54/59
50% Branches 1/2
69.23% Functions 9/13
91.53% Lines 54/59

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
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155

    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x
    1x

    1x
    6x

    1x

    1x

    1x

    1x
    7x
    7x

    1x
    1x
    1x
    1x

    1x

    1x
    1x
    8x

    1x

    1x
    1x
    2x
    2x
    2x

    1x

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x

    1x

     'use strict';

    var Curry = require("bs-platform/lib/js/curry.js");
    var Caml_option = require("bs-platform/lib/js/caml_option.js");
    var Relude_Option = require("./Relude_Option.bs.js");
    var Relude_Extensions_Apply = require("./extensions/Relude_Extensions_Apply.bs.js");
    var Relude_Extensions_Monad = require("./extensions/Relude_Extensions_Monad.bs.js");
    var Relude_Extensions_Functor = require("./extensions/Relude_Extensions_Functor.bs.js");
    var Relude_Extensions_Applicative = require("./extensions/Relude_Extensions_Applicative.bs.js");

    function WithMonad(M) {
      var make = function (mOptionA) {
        return /* OptionT */[mOptionA];
      };
      var runOptionT = function (param) {
        return param[0];
      };
      var mapOptionT = function (mOptionAToMOptionB, param) {
        return /* OptionT */[Curry._1(mOptionAToMOptionB, param[0])];
      };
      var fromOption = function (optionA) {
        return /* OptionT */[Curry._1(M[/* pure */2], optionA)];
      };
      var liftF = function (mA) {
        return /* OptionT */[Curry._2(M[/* map */0], (function (a) {
                        return Caml_option.some(a);
                      }), mA)];
      };
      var map = function (aToB, param) {
        return /* OptionT */[Curry._2(M[/* map */0], (function (optionA) {
                        return Relude_Option.map(aToB, optionA);
                      }), param[0])];
      };
      var Functor = /* module */[/* map */map];
      var include = Relude_Extensions_Functor.FunctorExtensions(Functor);
      var apply = function (param, param$1) {
        return /* OptionT */[Curry._2(M[/* apply */1], Curry._2(M[/* map */0], Relude_Option.apply, param[0]), param$1[0])];
      };
      var Apply = /* module */[
        /* map */map,
        /* apply */apply
      ];
      var include$1 = Relude_Extensions_Apply.ApplyExtensions(Apply);
      var pure = function (a) {
        return /* OptionT */[Curry._1(M[/* pure */2], Caml_option.some(a))];
      };
      var Applicative = /* module */[
        /* map */map,
        /* apply */apply,
        /* pure */pure
      ];
      var include$2 = Relude_Extensions_Applicative.ApplicativeExtensions(Applicative);
      var bind = function (param, aToOptionTB) {
        return /* OptionT */[Curry._2(M[/* flat_map */3], param[0], (function (optionA) {
                        Eif (optionA !== undefined) {
                          return Curry._1(aToOptionTB, Caml_option.valFromOption(optionA))[0];
                        } else {
                          return Curry._1(M[/* pure */2], undefined);
                        }
                      }))];
      };
      var Monad = /* module */[
        /* map */map,
        /* apply */apply,
        /* pure */pure,
        /* flat_map */bind
      ];
      var include$3 = Relude_Extensions_Monad.MonadExtensions(Monad);
      var include$4 = Relude_Extensions_Functor.FunctorInfix(Functor);
      var include$5 = Relude_Extensions_Apply.ApplyInfix(Apply);
      var include$6 = Relude_Extensions_Monad.MonadInfix(Monad);
      var Infix_000 = /* FunctorExtensions */include$4[0];
      var Infix_001 = /* <$> */include$4[1];
      var Infix_002 = /* <#> */include$4[2];
      var Infix_003 = /* <$ */include$4[3];
      var Infix_004 = /* $> */include$4[4];
      var Infix_005 = /* <@> */include$4[5];
      var Infix_006 = /* ApplyExtensions */include$5[0];
      var Infix_007 = /* <*> */include$5[1];
      var Infix_008 = /* <* */include$5[2];
      var Infix_009 = /* *> */include$5[3];
      var Infix_010 = /* MonadExtensions */include$6[0];
      var Infix_011 = /* >>= */include$6[1];
      var Infix_012 = /* =<< */include$6[2];
      var Infix_013 = /* >=> */include$6[3];
      var Infix_014 = /* <=< */include$6[4];
      var Infix = /* module */[
        Infix_000,
        Infix_001,
        Infix_002,
        Infix_003,
        Infix_004,
        Infix_005,
        Infix_006,
        Infix_007,
        Infix_008,
        Infix_009,
        Infix_010,
        Infix_011,
        Infix_012,
        Infix_013,
        Infix_014
      ];
      return /* module */[
              /* make */make,
              /* runOptionT */runOptionT,
              /* mapOptionT */mapOptionT,
              /* fromOption */fromOption,
              /* liftF */liftF,
              /* map */map,
              /* Functor */Functor,
              /* BsFunctorExtensions */include[0],
              /* flipMap */include[1],
              /* void */include[2],
              /* voidRight */include[3],
              /* voidLeft */include[4],
              /* flap */include[5],
              /* apply */apply,
              /* Apply */Apply,
              /* BsApplyExtensions */include$1[0],
              /* applyFirst */include$1[1],
              /* applySecond */include$1[2],
              /* map2 */include$1[3],
              /* map3 */include$1[4],
              /* map4 */include$1[5],
              /* map5 */include$1[6],
              /* tuple2 */include$1[7],
              /* tuple3 */include$1[8],
              /* tuple4 */include$1[9],
              /* tuple5 */include$1[10],
              /* mapTuple2 */include$1[11],
              /* mapTuple3 */include$1[12],
              /* mapTuple4 */include$1[13],
              /* mapTuple5 */include$1[14],
              /* pure */pure,
              /* Applicative */Applicative,
              /* BsApplicativeExtensions */include$2[0],
              /* liftA1 */include$2[1],
              /* bind */bind,
              /* Monad */Monad,
              /* BsMonadExtensions */include$3[0],
              /* flatMap */include$3[1],
              /* flatten */include$3[2],
              /* composeKleisli */include$3[3],
              /* flipComposeKleisli */include$3[4],
              /* liftM1 */include$3[5],
              /* when_ */include$3[6],
              /* unless */include$3[7],
              /* Infix */Infix
            ];
    }

    exports.WithMonad = WithMonad;
    /* Relude_Option Not a pure module */