Skip to content

Commit

Permalink
getRaceMonoid added to Wave and WaveR
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte Legenhausen committed Feb 11, 2020
1 parent 60e6695 commit 6814304
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,3 +1171,10 @@ export function getMonoid<E, A>(m: Monoid<A>): Monoid<Wave<E, A>> {
empty: pure(m.empty)
}
}

export function getRaceMonoid<E, A>(): Monoid<Wave<E, A>> {
return {
concat: race,
empty: never
}
}
7 changes: 7 additions & 0 deletions src/waver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,10 @@ export function getSemigroup<R, E, A>(m: Semigroup<A>): Semigroup<WaveR<R, E, A>
export function getMonoid<R, E, A>(m: Monoid<A>): Monoid<WaveR<R, E, A>> {
return reader.getMonoid(wave.getMonoid(m));
}

export function getRaceMonoid<R, E, A>(): Monoid<WaveR<R, E, A>> {
return {
concat: race,
empty: never
}
}

0 comments on commit 6814304

Please sign in to comment.