capability-0.1.0.0: Extensional capabilities and deriving combinators

Safe HaskellNone
LanguageHaskell2010

Capability.Writer.Discouraged

Contents

Description

Defines discouraged instances of writer monad capabilities.

Orphan instances

(HasWriter tag w m, MonadTransUnlift t, Monad (t m)) => HasWriter (tag :: Type) w (Lift (t m)) Source #

Lift one layer in a monad transformer stack.

Note, that if the HasWriter instance is based on HasState, then it is more efficient to apply Lift to the underlying state capability. E.g. you should favour

deriving (HasWriter tag w) via
  WriterLog (Lift (SomeTrans (MonadState SomeStateMonad)))

over

deriving (HasWriter tag w) via
  Lift (SomeTrans (WriterLog (MonadState SomeStateMonad)))
Instance details

Methods

writer_ :: Proxy# tag -> (a, w) -> Lift (t m) a Source #

tell_ :: Proxy# tag -> w -> Lift (t m) () Source #

listen_ :: Proxy# tag -> Lift (t m) a -> Lift (t m) (a, w) Source #

pass_ :: Proxy# tag -> Lift (t m) (a, w -> w) -> Lift (t m) a Source #