Implicit parameters
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
The GHC manual on implicit parameters: [1].
Working example:
{-# LANGUAGE ImplicitParams #-} import Data.List (sortBy) sort :: (?cmp :: a -> a -> Ordering) => [a] -> [a] sort = sortBy ?cmp main = let ?cmp = compare in putStrLn (show (sort [3,1,2]))