purescript-contrib / purescript-fixed-points

Types for the least and greatest fixed points of functors.
15 stars 9 forks source link

`Semigroup` / `Monoid` instances on `Mu` aren’t unique. #13

Open sellout opened 6 years ago

sellout commented 6 years ago

E.g., Mu Maybe has the myriad instances over natural numbers, Mu (XNor a) has the free monoid instance, etc. I feel like it should maybe be

instance Alt f => Semigroup (First (Mu f))

(assuming there’s some newtype First) to avoid blessing this instance over other ones that users may be expecting depending on the pattern functor.

eviefp commented 4 years ago

I think this has been fixed by #12, unless I'm misunderstanding.

thomashoneyman commented 4 years ago

I think this may be in response to #12, which uses a different instance:

instance semigroupMu :: Alt f => Semigroup (Mu f) where
  append (In x) (In y) = In (x <|> y)
thomashoneyman commented 3 years ago

We have an upcoming breaking release for PureScript 0.14 for this library, and I think this issue should be resolved as part of that release.

thomashoneyman commented 3 years ago

We may not be able to get this in for 0.14 due to a backlog of other work, so I'm going to remove the label.