
4 Jan
2016
4 Jan
'16
4:33 p.m.
would certainly require an Ord constraint on a, but where would I put it? I can put it on all the functions manipulating OrdLists, but I still wouldn't know how to define a functor instance, because a Functor a does not require Ord a.
It's of questionable utility, as it still doesn't let you define a Functor instance (and can no longer be a newtype), but if you want, you can use a GADT: data OrdList a where OrdList :: Ord a => a -> OrdList a Best regards Marcin Mrotek