Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
task error from promise should not be nullable (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuminecz committed Jan 4, 2017
1 parent aba5b35 commit 7e9bfbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phantasy",
"version": "0.11.0",
"version": "0.11.1",
"description": "",
"author": "Tim Kuminecz <tkuminecz@gmail.com>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ export class Task<A, X> {
*
* Converts a promise to a task
*/
static fromPromise<A>(promise: Promise<A>): Task<A, ?Error> {
static fromPromise<A>(promise: Promise<A>): Task<A, Error> {
return new Task((succ, fail) => { promise.then(succ).catch(fail); });
}

/**
* fromPromiseFunc :: (() -> Promise a) -> Task a Error
*/
static fromPromiseFunc<A>(promiseFn: () => Promise<A>): Task<A, ?Error> {
static fromPromiseFunc<A>(promiseFn: () => Promise<A>): Task<A, Error> {
return Task.fromPromise(promiseFn());
}

Expand Down

0 comments on commit 7e9bfbb

Please sign in to comment.