Created
November 1, 2016 20:51
-
-
Save zhangchiqing/905dcb3b94e6f8351bea751707bf4339 to your computer and use it in GitHub Desktop.
Maybe Promise a -> Promise Maybe a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var P = require('bluebird-promisell'); | |
var S = require('sanctuary').create({ checkTypes: true, env: require('sanctury').env }); | |
// toPromiseMaybe :: Maybe Promise a -> Promise Maybe a | |
var toPromiseMaybe = S.maybe(P.purep(S.Nothing()), P.liftp1(S.Just)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment