diff options
| author | Oleg Grenrus <oleg.grenrus@iki.fi> | 2015-03-17 11:03:44 -0500 |
|---|---|---|
| committer | Austin Seipp <austin@well-typed.com> | 2015-03-17 11:03:45 -0500 |
| commit | 3f3782df63f7c55382a25687a8e5c7f64202fa0a (patch) | |
| tree | 6be82db01ae602ed9771480dd7ea0636d2136d34 /libraries/base/Control/Monad/Fix.hs | |
| parent | dbd929971c05b5a05129029657a354ddfb658e61 (diff) | |
| download | haskell-3f3782df63f7c55382a25687a8e5c7f64202fa0a.tar.gz | |
Add more MonadZip instances
Summary: Add MonadZip Alt and MonadFix Alt instances
Reviewers: ekmett, dfeuer, hvr, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D716
GHC Trac Issues: #10107
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 ef8eeee776..ae37911c18 100644 --- a/libraries/base/Control/Monad/Fix.hs +++ b/libraries/base/Control/Monad/Fix.hs @@ -26,7 +26,8 @@ module Control.Monad.Fix ( import Data.Either import Data.Function ( fix ) import Data.Maybe -import Data.Monoid ( Dual(..), Sum(..), Product(..), First(..), Last(..) ) +import Data.Monoid ( Dual(..), Sum(..), Product(..) + , First(..), Last(..), Alt(..) ) import GHC.Base ( Monad, error, (.) ) import GHC.List ( head, tail ) import GHC.ST @@ -99,3 +100,6 @@ instance MonadFix First where instance MonadFix Last where mfix f = Last (mfix (getLast . f)) + +instance MonadFix f => MonadFix (Alt f) where + mfix f = Alt (mfix (getAlt . f)) |
