diff options
Diffstat (limited to 'libraries/base/Data/Functor/Const.hs')
-rw-r--r-- | libraries/base/Data/Functor/Const.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/base/Data/Functor/Const.hs b/libraries/base/Data/Functor/Const.hs index 9f2db7f1dc..8f54b4204c 100644 --- a/libraries/base/Data/Functor/Const.hs +++ b/libraries/base/Data/Functor/Const.hs @@ -43,22 +43,29 @@ newtype Const a b = Const { getConst :: a } -- | This instance would be equivalent to the derived instances of the -- 'Const' newtype if the 'runConst' field were removed +-- +-- @since 4.8.0.0 instance Read a => Read (Const a b) where readsPrec d = readParen (d > 10) $ \r -> [(Const x,t) | ("Const", s) <- lex r, (x, t) <- readsPrec 11 s] -- | This instance would be equivalent to the derived instances of the -- 'Const' newtype if the 'runConst' field were removed +-- +-- @since 4.8.0.0 instance Show a => Show (Const a b) where showsPrec d (Const x) = showParen (d > 10) $ showString "Const " . showsPrec 11 x +-- | @since 4.7.0.0 instance Foldable (Const m) where foldMap _ _ = mempty +-- | @since 2.01 instance Functor (Const m) where fmap _ (Const v) = Const v +-- | @since 2.0.1 instance Monoid m => Applicative (Const m) where pure _ = Const mempty (<*>) = coerce (mappend :: m -> m -> m) |