From 052f876fb3ec7874b90c634e7ecb310d4f595c6e Mon Sep 17 00:00:00 2001 From: csgn Date: Mon, 5 Aug 2024 19:36:30 +0300 Subject: [PATCH] [REFACTOR]: Unimportant change --- src/main/scala/kuram/monoid/laws.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/kuram/monoid/laws.scala b/src/main/scala/kuram/monoid/laws.scala index 69f260c..2b1b05f 100644 --- a/src/main/scala/kuram/monoid/laws.scala +++ b/src/main/scala/kuram/monoid/laws.scala @@ -24,24 +24,24 @@ package monoid package object laws { trait MonoidLaws[T] { - implicit def M: Monoid[T] + implicit def F: Monoid[T] /** must obey: `id + x == x + id` */ - def identityLaw(x: T): Boolean = - (M.combine(M.empty, x) == x) == (M.combine(x, M.empty) == x) + def identity(x: T): Boolean = + (F.combine(F.empty, x) == x) == (F.combine(x, F.empty) == x) /** must obey: `a + (b + c) = (a + b) + c` */ def associativity(a: T, b: T, c: T): Boolean = - M.combine(a, M.combine(b, c)) == M.combine(M.combine(a, b), c) + F.combine(a, F.combine(b, c)) == F.combine(F.combine(a, b), c) /** must obey: `f(a) + f(b) == f(a + b)` */ def homomorphism[U](a: T, b: T)(f: T => U)(using U: Monoid[U]): Boolean = - U.combine(f(a), f(b)) == f(M.combine(a, b)) + U.combine(f(a), f(b)) == f(F.combine(a, b)) } object MonoidLaws { def apply[T](using monoid: Monoid[T]): MonoidLaws[T] = new { - implicit def M: Monoid[T] = monoid + implicit def F: Monoid[T] = monoid } } }