jtdaugherty / vty

A high-level ncurses alternative written in Haskell
BSD 3-Clause "New" or "Revised" License
319 stars 57 forks source link

Why is `Eq v` necessary for the `Semigroup` and `Monoid` for the `MaybeDefault` datatype #226

Closed KommuSoft closed 3 years ago

KommuSoft commented 3 years ago

I'm wondering why we need as type constraint Eq v for the instances of Semigroup and Monoid. While we will likely eventually need the Eq instance, at the instance level of Semigroup and Monoid, we do not make use of any function that is defined in Eq.

https://github.com/jtdaugherty/vty/blob/fe501ccf2716826bf6ea05a666bbcfab36631ca6/src/Graphics/Vty/Attributes.hs#L154-L163

jtdaugherty commented 3 years ago

It turns out we don't! Those constraints are redundant, probably made so by some recent changes. I removed them in abf7fc4cd7d7a2fd69510743c62bff99e42a2541 just now. Thanks for mentioning this!