
4 Jan
2016
4 Jan
'16
2:53 p.m.
is it impossible to write a functor instance for ordered lists?
is such specialized functor instance necessary? I mean, why not fmap over unconstrained list and init OrdList before passing it to a fun where sorted list is really essential? this would eliminate the need to maintain sorted order at every step in list processing. This way, OrdList type would ensure that sort-critical consumer fun gets a sorted list, and every other fun - fmap or not - would not care.