[Haskell-beginners] Functor instance for ordered lists

Imants Cekusins imantc at gmail.com
Mon Jan 4 14:53:34 UTC 2016


> 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.


More information about the Beginners mailing list