hdgarrood / purescript-sequences

Various efficient-ish sequence types for PureScript.
http://pursuit.purescript.org/packages/purescript-sequences
MIT License
45 stars 22 forks source link

Monoid Instance for FingerTree? #38

Open solomon-b opened 2 years ago

solomon-b commented 2 years ago

Is there any reason not to include a monoid instance for FingerTree?

instance monoidFingerTree :: (Monoid v, Measured a v) => Monoid (FingerTree v a) where
  mempty = Empty
hdgarrood commented 2 years ago

That seems fine, especially since the Semigroup instance is already there. I think the most likely explanations are either that I wrote this before Monoid was in Prelude and I couldn't be bothered to add the dependency initially, and/or that I've not found a use for it.

solomon-b commented 2 years ago

Sorry for the slow reply. Its not strictly necessary but it is nice to have for the sake of completeness.