1{-# LANGUAGE UndecidableInstances #-}
2module Effectful.Class.Reader
7import Control.Monad.Trans.Class
8import Control.Monad.Trans.Control
10import Effectful.Internal.Effect
11import Effectful.Internal.Monad
12import qualified Effectful.Reader as R
14-- | Compatiblity layer for a transition period from MTL-style effect handling
16class Monad m => MonadReader r m where
17 {-# MINIMAL (ask | reader), local #-}
21 local :: (r -> r) -> m a -> m a
23 reader :: (r -> a) -> m a
24 reader f = ask >>= pure . f
26-- | Generic, overlappable instance.
27instance {-# OVERLAPPABLE #-}
31 ) => MonadReader r (t m) where
33 local f m = liftWith (\run -> local f (run m)) >>= restoreT . pure
34 reader = lift . reader
36instance R.Reader r :> es => MonadReader r (Eff es) where
41asks :: MonadReader r m => (r -> a) -> m a
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list