I want to create a type called TwoValued and it contains two values: a and b, and I'd like to make sure that a <= b
data TwoValued a b | a <= b = ValuePair a b
| otherwise = ValuePair b a
But it's not working, I think guarded equation is not allowed here, so is there any other way to achieve what I want? Thanks.