Skip to content

Commit

Permalink
Fix styling 馃拝馃徏
Browse files Browse the repository at this point in the history
  • Loading branch information
kutyel committed Dec 13, 2017
1 parent a0c95dd commit 4625af9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions functors.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const { curry } = require('.')
* Identity
*/
class Identity {
constructor(x) {
constructor (x) {
this.__value = x
}

static of(x) {
static of (x) {
return new Identity(x)
}

map(f) {
map (f) {
return Identity.of(f(this.__value))
}
}
Expand All @@ -27,19 +27,19 @@ class Identity {
* Maybe
*/
class Maybe {
constructor(x) {
constructor (x) {
this.__value = x
}

static of(x) {
static of (x) {
return new Maybe(x)
}

isNothing(f) {
isNothing (f) {
return this.__value === null || this.__value === undefined
}

map(f) {
map (f) {
return this.isNothing() ? Maybe.of(null) : Maybe.of(f(this.__value))
}
}
Expand Down Expand Up @@ -71,16 +71,16 @@ class Maybe {
* Left
*/
class Left {
constructor(x) {
constructor (x) {
this.__value = x
}

// TODO: remove this nonsense
static of(x) {
static of (x) {
return new Left(x)
}

map(f) {
map (f) {
return this
}
}
Expand All @@ -105,16 +105,16 @@ class Left {
* Right
*/
class Right {
constructor(x) {
constructor (x) {
this.__value = x
}

// TODO: remove in favor of Either.of
static of(x) {
static of (x) {
return new Right(x)
}

map(f) {
map (f) {
return Right.of(f(this.__value))
}
}
Expand Down Expand Up @@ -149,11 +149,11 @@ class Right {
* IO
*/
class IO {
constructor(f) {
constructor (f) {
this.unsafePerformIO = f
}

static of(x) {
static of (x) {
return new IO(() => x)
}
}
Expand Down

0 comments on commit 4625af9

Please sign in to comment.