Context in data instances
问题 I have a datatype which only makes sense if its arguments can be ordered, however I seem to be needing to get deep into some complex and potentially hacky stuff to get it to work (GADTs, mainly). Is what I'm doing (constrained datatypes) considered bad haskell practice, and is there any way around this? For those interested, here's the relevant code: {-# LANGUAGE GADTs #-} {-# LANGUAGE InstanceSigs #-} import Data.List (sort) data OrdTriple a where OrdTriple :: (Ord a) => a -> a -> a ->