Skip to content

Commit

Permalink
Workaround for dart-lang/sdk#35097 (closes #12 and #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
spebbe committed Jun 17, 2019
1 parent e26a8e4 commit c95ac0a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/src/endo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ part of dartz;

typedef A Endo<A>(A a);

class EndoMonoid<A> extends Monoid<Endo<A>> {
@override Endo<A> zero() => (A a) => a;

@override Endo<A> append(Endo<A> e1, Endo<A> e2) => (A a) => e1(e2(a));
}

final Monoid<Endo> EndoMi = new EndoMonoid();
Monoid<Endo<A>> endoMi<A>() => new EndoMonoid();
Monoid<Endo<A>> endoMi<A>() => monoid(() => (A a) => a, (Endo<A> e1, Endo<A> e2) => (A a) => e1(e2(a)));
final Monoid<Endo> EndoMi = endoMi();

final Monoid<Endo> DualEndoMi = dualMonoid(EndoMi);
Monoid<Endo<A>> dualEndoMi<A>() => dualMonoid(endoMi());

0 comments on commit c95ac0a

Please sign in to comment.