Skip to content

Commit 5acafe9

Browse files
committed
either.js clean up
1 parent 12c2a36 commit 5acafe9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/either.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Left extends Either {
1111
this.isRight = false
1212
// ----- Functor (Either a)
1313
this.map = () => this
14-
this.join = () => this
14+
this.join = this.map
1515
}
1616
// ----- Applicative (Either a)
1717
// ap() { return this }
@@ -31,7 +31,7 @@ class Right extends Either {
3131
this.isRight = true
3232
// ----- Functor (Either a)
3333
this.map = fn => Either.of(fn(x))
34-
this.join = () => this._
34+
this.join = () => x
3535
}
3636
// ----- Applicative (Either a)
3737
// ap(f) { return f.map(this._) }

0 commit comments

Comments
 (0)