@zoowar thanks! thats super useful in showing why I don't understand it good enough, and a little knowledge can be dangerous. Of course the type signature of sort is not general enough, with it's restriction to Ordered types. How about a working proper example, using reverse .. so
g f l = map f $ reverse l
h f l = reverse $ map f l
have the same output for any f :: a ->b, and l :: [a]
?