#NEWLINE# @ sig ( ( ( ( ( H [ ( Ord , 'a' ) ] / ( ( H / 'a' ) >> 'b' ) ) >> 'b' ) >> 'b' ) >> Ordering ) ) #NEWLINE# def comparing( p , x , y ) : #NEWLINE# #INDENT# '\n    comparing :: Ord a => (b -> a) -> b -> b -> Ordering\n\n    comparing(p, x, y) = compare(p(x), p(y))\n\n    Useful combinator for use in conjunction with the xxxBy family of functions\n    from Data.List, for example:\n\n    ... sortBy (comparing(fst)) ...\n    ' #NEWLINE# return compare ( p ( x ) , p ( y ) )