You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
Semigroup/Monoid.combineN: Express partiality with values not exceptions #84
After reading http://plastic-idolatry.com/erik/sw2015.pdf it looks like Semigroup.combineN and Monoid.combineN currently only meet goal number 7 (Pragmatic) but not goal number 2 (Safe: Express partiality with values not exceptions).
/** * Return `a` combined with itself `n` times.*/defcombineN(a: A, n: Int):A=if (n <=0) thrownewIllegalArgumentException("Repeated combining for semigroups must have n > 0")
else repeatedCombineN(a, n)
After reading http://plastic-idolatry.com/erik/sw2015.pdf it looks like
Semigroup.combineNandMonoid.combineNcurrently only meet goal number 7 (Pragmatic) but not goal number 2 (Safe: Express partiality with values not exceptions).