1module Control.Monad.State
3import Control.Monad.Identity
8class Monad m => MonadState s (m : Set -> Set) where
12record StateT : Set -> (Set -> Set) -> Set -> Set where
13 ST : {m : Set -> Set} ->
14 (runStateT : s -> m (a, s)) -> StateT s m a
16instance Monad m => Monad (StateT s m) where
17 return x = ST (\st => return (x, st))
19 (ST f) >>= k = ST (\st => do (v, st') <- f st
23instance Monad m => MonadState s (StateT s m) where
24 get = ST (\x => return (x, x))
25 put x = ST (\y => return ((), x))
27State : Set -> Set -> Set
28State s a = StateT s Identity 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