Alternative newtype wrappers for oset

2019-02-05

I recently published oset-0.1.1.0 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-0.4.0.1 released
New packages
View patterns
oset
First package on Hackage

Tags

Haskell
Hackage
oset

All content © 2019 Richard Cook. All rights reserved.