allDistinct :: Ord a => [a] -> Bool
allDistinct = recurse Set.empty where
  recurse seen [] = True
  recurse seen (r:rs)
    | r `Set.member` seen = False
    | otherwise           = recurse (r `Set.insert` seen) rs
allDistinct :: Ord a => [a] -> Bool
allDistinct = recurse Set.empty where
  recurse seen [] = True
  recurse seen (r:rs)
    | r `Set.member` seen = False
    | otherwise           = recurse (r `Set.insert` seen) rs
allDistinct = recurse Set.empty where
  recurse seen [] = True
  recurse seen (r:rs)
    | r `Set.member` seen = False
    | otherwise           = recurse (r `Set.insert` seen) rs