1-- | The 'Writer' as an effect.
13import qualified Data.Semigroup as S
15import Effectful.Internal.Has
16import Effectful.Internal.Monad
18-- | Provide access to a write only value of type @w@.
19newtype Writer w = Writer w
20 deriving (S.Semigroup, Monoid)
22runWriter :: Monoid w => Eff (Writer w : es) a -> Eff es (a, w)
23runWriter = fmap coerce . runEffect mempty
25execWriter :: Monoid w => Eff (Writer w : es) a -> Eff es w
26execWriter = fmap coerce . execEffect mempty
28writer :: (Writer w :> es, Monoid w) => (a, w) -> Eff es a
29writer (a, w) = stateEffect $ \w0 -> (a, w0 `mappend` Writer w)
31tell :: (Writer w :> es, Monoid w) => w -> Eff es ()
32tell w = stateEffect $ \w0 -> ((), w0 `mappend` Writer w)
35 :: (Writer w :> es, Monoid w)
38listen = fmap (\(a, Writer w) -> (a, w)) . listenEffect
41 :: (Writer w :> es, Monoid w)
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