{-# options -ddump-simpl -dsuppress-all -dsuppress-uniques -dno-typeable-binds #-} module Playground where import Data.List (maximumBy) import Data.Ord (comparing) maxBy :: (a -> Int) -> a -> a -> a maxBy measure a b = maximumBy (comparing measure) [a, b]