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
Monoid instances and replace them with
newtype wrappers providing the desired behaviours. Here’s a sketch of what I intend to do:
rightPreservingAppend are not the real implementations but are provided for illustrative purposes only.
Content © 2010–2021 Richard Cook. All rights reserved.