diff options
| author | chessai <chessai1996@gmail.com> | 2018-04-11 18:28:41 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-27 16:43:42 -0400 |
| commit | b67e8a3f107f7e7b2cefb526a5f956a4a3abc852 (patch) | |
| tree | efc2140c4714dc1d756f92d8f2663187ddeaf298 /libraries/base/Control/Monad/Fix.hs | |
| parent | 6a9b9b431dcc94849d14c13639eb2f713e5aa1f4 (diff) | |
| download | haskell-b67e8a3f107f7e7b2cefb526a5f956a4a3abc852.tar.gz | |
base: Introduce Data.Monoid.Ap
This data type witnesses the lifting of a monoid into an applicative
pointwise.
Diffstat (limited to 'libraries/base/Control/Monad/Fix.hs')
| -rw-r--r-- | libraries/base/Control/Monad/Fix.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/base/Control/Monad/Fix.hs b/libraries/base/Control/Monad/Fix.hs index 568568af84..4c333c32ed 100644 --- a/libraries/base/Control/Monad/Fix.hs +++ b/libraries/base/Control/Monad/Fix.hs @@ -28,7 +28,7 @@ import Data.Either import Data.Function ( fix ) import Data.Maybe import Data.Monoid ( Dual(..), Sum(..), Product(..) - , First(..), Last(..), Alt(..) ) + , First(..), Last(..), Alt(..), Ap(..) ) import GHC.Base ( Monad, NonEmpty(..), errorWithoutStackTrace, (.) ) import GHC.Generics import GHC.List ( head, tail ) @@ -126,6 +126,10 @@ instance MonadFix Last where instance MonadFix f => MonadFix (Alt f) where mfix f = Alt (mfix (getAlt . f)) +-- | @since 4.12.0.0 +instance MonadFix f => MonadFix (Ap f) where + mfix f = Ap (mfix (getAp . f)) + -- Instances for GHC.Generics -- | @since 4.9.0.0 instance MonadFix Par1 where |
