typelevel / cats

Lightweight, modular, and extensible library for functional programming.
https://typelevel.org/cats/
Other
5.23k stars 1.19k forks source link

How should we deal with typeclasses that need particular instances of other typeclasses to be lawful? #805

Open johnynek opened 8 years ago

johnynek commented 8 years ago

See: https://github.com/non/algebra/pull/126#discussion_r45569352

Group[Map[K, V]] needs a vetor space style Eq[Map[K, V]] that considers eqv(Some(0), None)

one proposal is for the dependant typeclass to have as a member the depended typeclass (def eqInst: Eq[Map[K, V]])

rklaehn commented 8 years ago

Not 100% related to this question: I am not sure if you followed the discussion. But I think it would probably be best to leave instances out of cats-kernel for now to reduce the potential for disagreement. Do you agree?

johnynek commented 8 years ago

Yes, I just wanted to add an issue to not lose track of this design problem.

Agree we should leave instances out for now.