[Haskell-beginners] Functor instance for ordered lists

Imants Cekusins imantc at gmail.com
Mon Jan 4 10:45:52 UTC 2016


> a newtype for ordered lists

why not:
newtype Ordlist a = Ordlist [a]

and a ctor:
ordList::[a]->OrdList a
ordList = OrdList . sort

sort :: Ord a => [a] -> [a]
from Data.List


More information about the Beginners mailing list