refined-cats: Semigroup for numeric types
See original GitHub issueAFAICS it should be possible to define a Semigroup[A Refined Positive]
for any A : Semigroup
, as well as for Semigroup[A Refined Negative]
(adding two negative numbers still gives a negative number).
WDYT about adding something like that to the refined-cats module?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
fthomas/refined - Gitter
NonNegative import eu.timepit.refined.types.numeric. ... The refined-cats module has a Semigroup instance for NonNegInt that overflows to 0 and where ...
Read more >Semigroup - Typelevel
N.B. Cats defines the Semigroup type class in cats-kernel. The cats package object defines type aliases to the Semigroup from cats-kernel, so that...
Read more >Semigroups and Monoids in Scala - Rock the JVM Blog
This article is about Monoids and Semigroups as a gentle introduction to functional abstractions and to how the Cats library works.
Read more >Refinement monoids, equidecomposability types, and ...
that they encode a large number of embedding problems of (not necessarily ... Type monoids of Boolean inverse meet-semigroups.
Read more >Semigroup.ts - fp-ts
A common example of a semigroup is the type string with the operation + . import { Semigroup } from 'fp-ts/Semigroup' const semigroupString: ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That makes sense and it’s much better than returning the MaxValue. I will try to work on it and submit a PR.
I see… then let’s add some instances for actual types 😃 I’ll come up with some PR when I have time.