nubOrdOn :: Ord b => (a -> b) -> [a] -> [a]
nubOrdOn g = let f a s = let e = g a in
                   if Set.member e s then Nothing else Just (Set.insert e s)
  in nubWith f Set.empty
nubOrdOn :: Ord b => (a -> b) -> [a] -> [a]
nubOrdOn g = let f a s = let e = g a in
                   if Set.member e s then Nothing else Just (Set.insert e s)
  in nubWith f Set.empty
nubOrdOn g = let f a s = let e = g a in
                   if Set.member e s then Nothing else Just (Set.insert e s)
  in nubWith f Set.empty