Commit 2643ba46 authored by Paavo Parkkinen's avatar Paavo Parkkinen Committed by Marge Bot

Add example and doc for Arg (Fixes #17153)

parent 19f12557
Pipeline #17073 failed with stages
in 519 minutes and 47 seconds
......@@ -286,7 +286,15 @@ instance Num a => Num (Max a) where
-- | 'Arg' isn't itself a 'Semigroup' in its own right, but it can be
-- placed inside 'Min' and 'Max' to compute an arg min or arg max.
data Arg a b = Arg a b deriving
--
-- >>> minimum [ Arg (x * x) x | x <- [-10 .. 10] ]
-- Arg 0 0
data Arg a b = Arg
a
-- ^ The argument used for comparisons in 'Eq' and 'Ord'.
b
-- ^ The "value" exposed via the 'Functor', 'Foldable' etc. instances.
deriving
( Show -- ^ @since 4.9.0.0
, Read -- ^ @since 4.9.0.0
, Data -- ^ @since 4.9.0.0
......
Markdown is supported
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