Commit 2ab5e6cb authored by Simon Marlow's avatar Simon Marlow
Browse files

generalise the type of "on"

parent cb913bbf
...@@ -523,7 +523,7 @@ sortWith get_key xs = sortLe le xs ...@@ -523,7 +523,7 @@ sortWith get_key xs = sortLe le xs
where where
x `le` y = get_key x < get_key y x `le` y = get_key x < get_key y
on :: (a -> a -> Ordering) -> (b -> a) -> b -> b -> Ordering on :: (a -> a -> c) -> (b -> a) -> b -> b -> c
on cmp sel = \x y -> sel x `cmp` sel y on cmp sel = \x y -> sel x `cmp` sel y
\end{code} \end{code}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment