1{-# LANGUAGE UndecidableInstances #-}
2module Effectful.Class.State where
4import Control.Monad.Trans.Class
6import Effectful.Internal.Effect
7import Effectful.Internal.Monad
8import qualified Effectful.State as S
10-- | Compatiblity layer for a transition period from MTL-style effect handling
12class Monad m => MonadState s m where
13 {-# MINIMAL state | get, put #-}
16 get = state (\s -> (s, s))
19 put s = state (\_ -> ((), s))
21 state :: (s -> (a, s)) -> m a
27-- | Generic, overlappable instance.
28instance {-# OVERLAPPABLE #-}
32 ) => MonadState s (t m) where
37instance S.State s :> es => MonadState s (Eff es) where
42gets :: MonadState s m => (s -> a) -> m a
45modify :: MonadState s m => (s -> s) -> m ()
46modify f = state (\s -> ((), f s))
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