Alternative newtype wrappers for oset


I recently published oset- in order to get around some (perceived, by me) shortcomings of ordered-containers. Mainly I was frustrated by the lack of Semigroup and Monoid instances.

In retrospect, I think I should have thought some more before ploughing ahead and implementing them the way I did, mainly because there are ( think) at least two valid, and obvious, possible instances of these type classes for an ordered set. Specifically:

Therefore, I’m planning to remove the existing Semigroup and Monoid instances and replace them with newtype wrappers providing the desired behaviours. Here’s a sketch of what I intend to do:

leftPreservingAppend and rightPreservingAppend are not the real implementations but are provided for illustrative purposes only.

Related posts

oset- released
New packages
View patterns
First package on Hackage



Content © 2024 Richard Cook. All rights reserved.