From c95ac0af75de7fb1671b0e29b15904d3723cce27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Sperber?= Date: Mon, 17 Jun 2019 18:41:58 +0200 Subject: [PATCH] Workaround for https://github.com/dart-lang/sdk/issues/35097 (closes #12 and #16) --- lib/src/endo.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/src/endo.dart b/lib/src/endo.dart index 68d7aa2..025f962 100644 --- a/lib/src/endo.dart +++ b/lib/src/endo.dart @@ -2,14 +2,8 @@ part of dartz; typedef A Endo(A a); -class EndoMonoid extends Monoid> { - @override Endo zero() => (A a) => a; - - @override Endo append(Endo e1, Endo e2) => (A a) => e1(e2(a)); -} - -final Monoid EndoMi = new EndoMonoid(); -Monoid> endoMi() => new EndoMonoid(); +Monoid> endoMi() => monoid(() => (A a) => a, (Endo e1, Endo e2) => (A a) => e1(e2(a))); +final Monoid EndoMi = endoMi(); final Monoid DualEndoMi = dualMonoid(EndoMi); Monoid> dualEndoMi() => dualMonoid(endoMi());