question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refined-cats: Semigroup for numeric types

See original GitHub issue

AFAICS 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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dm-trancommented, Feb 23, 2019

That makes sense and it’s much better than returning the MaxValue. I will try to work on it and submit a PR.

1reaction
kubukozcommented, Jun 13, 2018

I see… then let’s add some instances for actual types 😃 I’ll come up with some PR when I have time.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found