Why does Data.Set require elements to be an instance of Ord?

Viewed 1639

This doesn't work

data Cutlery = Knife | Fork deriving (Show,Eq)
let x = [Knife,Fork]
let set1 = Set.fromList x

while defining

data Cutlery = Knife | Fork deriving (Show,Ord,Eq)

solves the issue but doesn't make sense. Is Data.Set different than the mathematical definition of a set?

4 Answers
Related