Example #1
0
 return Prelude[">>="](__dict_Monad_15["__superclass_Prelude.Bind_1"]())(runExceptT(n))(function (_8) {
     if (_8 instanceof Data_Either.Right) {
         return Prelude.pure(__dict_Monad_15["__superclass_Prelude.Applicative_0"]())(new Data_Either.Right(_8.value0));
     };
     if (_8 instanceof Data_Either.Left) {
         return Prelude.pure(__dict_Monad_15["__superclass_Prelude.Applicative_0"]())(new Data_Either.Left(Prelude["<>"](__dict_Semigroup_14)(_9.value0)(_8.value0)));
     };
     throw new Error("Failed pattern match");
 });
 return function (v) {
     if (v instanceof Data_Maybe.Nothing) {
         return Prelude.pure(dictApplicative)(Data_Maybe.Nothing.value);
     };
     if (v instanceof Data_Maybe.Just) {
         return Prelude["<$>"]((dictApplicative["__superclass_Prelude.Apply_0"]())["__superclass_Prelude.Functor_0"]())(Data_Maybe.Just.create)(f(v.value0));
     };
     throw new Error("Failed pattern match at Data.Traversable line 76, column 1 - line 82, column 1: " + [ f.constructor.name, v.constructor.name ]);
 };
Example #3
0
 return function (_593) {
     if (_593 instanceof Nil) {
         return Prelude.pure(__dict_Applicative_0)(Nil.value);
     };
     if (_593 instanceof Cons) {
         return Prelude["<*>"](__dict_Applicative_0["__superclass_Prelude.Apply_0"]())(Prelude["<$>"]((__dict_Applicative_0["__superclass_Prelude.Apply_0"]())["__superclass_Prelude.Functor_0"]())(Cons.create)(f(_593.value0)))(Data_Traversable.traverse(traversableList)(__dict_Applicative_0)(f)(_593.value1));
     };
     throw new Error("Failed pattern match");
 };
Example #4
0
 return function (handler) {
     return Prelude[">>="](__dict_Monad_8["__superclass_Prelude.Bind_1"]())(runExceptT(m))(Data_Either.either(Prelude["<<<"](Prelude.semigroupoidArr)(runExceptT)(handler))(Prelude["<<<"](Prelude.semigroupoidArr)(Prelude.pure(__dict_Monad_8["__superclass_Prelude.Applicative_0"]()))(Data_Either.Right.create)));
 };
Example #5
0
var throwE = function (__dict_Applicative_0) {
    return Prelude["<<<"](Prelude.semigroupoidArr)(ExceptT)(Prelude["<<<"](Prelude.semigroupoidArr)(Prelude.pure(__dict_Applicative_0))(Data_Either.Left.create));
};
Example #6
0
 return function (_575) {
     return Prelude.pure(__dict_Applicative_0)(_575);
 };
 return function (value) {
     if (tagOf(value) === tag) {
         return Prelude.pure(Data_Either.applicativeEither)(unsafeFromForeign(value));
     };
     return new Data_Either.Left(new TypeMismatch(tag, tagOf(value)));
 };
Example #8
0
 return function (f) {
     return Prelude["<<<"](Prelude.semigroupoidArr)(Prelude["<$>"]((__dict_Applicative_12["__superclass_Prelude.Apply_0"]())["__superclass_Prelude.Functor_0"]())(Wrap.create))(Prelude["<<<"](Prelude.semigroupoidArr)(Data_Bitraversable.bitraverse(__dict_Bitraversable_11)(__dict_Applicative_12)(Prelude.pure(__dict_Applicative_12))(f))(unwrap));
 };
Example #9
0
var plusMaybeT = function (__dict_Monad_0) {
    return new Control_Plus.Plus(function () {
        return altMaybeT(__dict_Monad_0);
    }, Prelude.pure(__dict_Monad_0["__superclass_Prelude.Applicative_0"]())(Data_Maybe.Nothing.value));
};
Example #10
0
var applicativeMaybeT = function (__dict_Monad_9) {
    return new Prelude.Applicative(function () {
        return applyMaybeT(__dict_Monad_9);
    }, Prelude["<<<"](Prelude.semigroupoidArr)(MaybeT)(Prelude["<<<"](Prelude.semigroupoidArr)(Prelude.pure(__dict_Monad_9["__superclass_Prelude.Applicative_0"]()))(Data_Maybe.Just.create)));
};
Example #11
0
 return function (a2) {
     return Prelude[">>="](bindAff)(attempt(a1))(Data_Either.either(Prelude["const"](a2))(Prelude.pure(applicativeAff)));
 };
Example #12
0
 return function (ex) {
     return Prelude[">>="](bindAff)(attempt(aff))(Data_Either.either(ex)(Prelude.pure(applicativeAff)));
 };
Example #13
0
};

/**
 *  | Creates an asynchronous effect from a function that accepts error and
 *  | success callbacks, and returns a canceler for the computation. This
 *  | function can be used for asynchronous computations that can be canceled.
 */
var makeAff$prime = function (h) {
    return _makeAff(h);
};

/**
 *  | Converts the asynchronous computation into a synchronous one. All values
 *  | and errors are ignored.
 */
var launchAff = runAff(Prelude["const"](Prelude.pure(Control_Monad_Eff.applicativeEff)(Prelude.unit)))(Prelude["const"](Prelude.pure(Control_Monad_Eff.applicativeEff)(Prelude.unit)));
var functorAff = new Prelude.Functor(function (f) {
    return function (fa) {
        return _fmap(f, fa);
    };
});

/**
 *  | Unwraps the canceler function from the newtype that wraps it.
 */
var cancel = function (_361) {
    return _361;
};

/**
 *  | Promotes any error to the value level of the asynchronous monad.
 return function (value) {
     if (Data_Foreign.isNull(value) || Data_Foreign.isUndefined(value)) {
         return Prelude.pure(Data_Either.applicativeEither)(Data_Maybe.Nothing.value);
     };
     return Prelude["<$>"](Data_Either.functorEither)(Prelude["<<<"](Prelude.semigroupoidArr)(NullOrUndefined)(Data_Maybe.Just.create))(f(value));
 };
}, function ($35) {
    return First(Prelude.pure(Data_Maybe.applicativeMaybe)($35));
});
Example #16
0
var applicativeExceptT = function (__dict_Applicative_11) {
    return new Prelude.Applicative(function () {
        return applyExceptT(__dict_Applicative_11["__superclass_Prelude.Apply_0"]());
    }, Prelude["<<<"](Prelude.semigroupoidArr)(ExceptT)(Prelude["<<<"](Prelude.semigroupoidArr)(Prelude.pure(__dict_Applicative_11))(Data_Either.Right.create)));
};
Example #17
0
}, function (v) {
    return Prelude.pure(Control_Monad_Aff.applicativeAff)(v);
});
Example #18
0
var monoidPar = function (__dict_Monoid_1) {
    return new Data_Monoid.Monoid(function () {
        return semigroupPar(__dict_Monoid_1["__superclass_Prelude.Semigroup_0"]());
    }, Prelude.pure(applicativePar)(Data_Monoid.mempty(__dict_Monoid_1)));
};
}, function (dictApplicative) {
    return $foreign.traverseArrayImpl(Prelude.apply(dictApplicative["__superclass_Prelude.Apply_0"]()))(Prelude.map((dictApplicative["__superclass_Prelude.Apply_0"]())["__superclass_Prelude.Functor_0"]()))(Prelude.pure(dictApplicative));
});
    return function (_168) {
        return Prelude["<*>"](Data_Maybe.applyMaybe)(_167)(_168);
    };
}, function () {
    return functorLast;
});
var bindLast = new Prelude.Bind(function (_169) {
    return function (f) {
        return Prelude[">>="](Data_Maybe.bindMaybe)(_169)(Prelude["<<<"](Prelude.semigroupoidArr)(runLast)(f));
    };
}, function () {
    return applyLast;
});
var applicativeLast = new Prelude.Applicative(function () {
    return applyLast;
}, Prelude["<<<"](Prelude.semigroupoidArr)(Last)(Prelude.pure(Data_Maybe.applicativeMaybe)));
var monadLast = new Prelude.Monad(function () {
    return applicativeLast;
}, function () {
    return bindLast;
});
module.exports = {
    Last: Last, 
    runLast: runLast, 
    eqLast: eqLast, 
    ordLast: ordLast, 
    functorLast: functorLast, 
    applyLast: applyLast, 
    applicativeLast: applicativeLast, 
    bindLast: bindLast, 
    monadLast: monadLast, 
Example #21
0
 return function (_676) {
     return new Joker(Prelude.pure(__dict_Applicative_13)(_676));
 };
Example #22
0
 return function (_576) {
     return Prelude.pure(__dict_Applicative_1)(_576);
 };
Example #23
0
 return function (f) {
     return foldr(__dict_Foldable_1)(Prelude["<<<"](Prelude.semigroupoidArr)(Control_Apply["*>"](__dict_Applicative_0["__superclass_Prelude.Apply_0"]()))(f))(Prelude.pure(__dict_Applicative_0)(Prelude.unit));
 };
var readArray = function (value) {
    if (isArray(value)) {
        return Prelude.pure(Data_Either.applicativeEither)(unsafeFromForeign(value));
    };
    return new Data_Either.Left(new TypeMismatch("array", tagOf(value)));
};