Maybe we need a MonadState s m => MonadReader s m instance some day ?
This commit is contained in:
parent
2c02e44adf
commit
3b3eeef218
1 changed files with 12 additions and 0 deletions
|
@ -17,10 +17,22 @@ module PDF.Box (
|
||||||
import Control.Monad.Except (ExceptT(..), runExceptT)
|
import Control.Monad.Except (ExceptT(..), runExceptT)
|
||||||
import Control.Monad.Fail (MonadFail(..))
|
import Control.Monad.Fail (MonadFail(..))
|
||||||
import Control.Monad.State (MonadState(..))
|
import Control.Monad.State (MonadState(..))
|
||||||
|
--import Control.Monad.Reader (MonadReader(..))
|
||||||
import Data.Map (Map)
|
import Data.Map (Map)
|
||||||
import qualified Data.Map as Map (insert, lookup, member)
|
import qualified Data.Map as Map (insert, lookup, member)
|
||||||
import Prelude hiding (fail)
|
import Prelude hiding (fail)
|
||||||
|
|
||||||
|
{-
|
||||||
|
instance (Monad m, MonadState s m) => MonadReader s m where
|
||||||
|
ask = get
|
||||||
|
local f m = do
|
||||||
|
backup <- get
|
||||||
|
put $ f backup
|
||||||
|
result <- m
|
||||||
|
put backup
|
||||||
|
return result
|
||||||
|
-}
|
||||||
|
|
||||||
newtype Index = Index Int
|
newtype Index = Index Int
|
||||||
newtype Maybe_ x = Maybe_ x
|
newtype Maybe_ x = Maybe_ x
|
||||||
newtype Either_ b x = Either_ x
|
newtype Either_ b x = Either_ x
|
||||||
|
|
Loading…
Reference in a new issue