You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Monad m => Logger m where
logStr :: String -> m ()
newtype TheLoggerReader m a = TheLoggerReader (m a)
deriving (Functor, Applicative, Monad)
instance (HasReader "logger" (String -> IO ()) m, MonadIO m) => Logger (TheLoggerReader m)
newtype CountLogM m a = CountLogM (ReaderT CountLogCtx m a)
deriving (Functor, Applicative, Monad)
deriving Logger via
(TheLoggerReader (Field "logger" (Field "logCtx" (MonadReader (ReaderT CountLogCtx m)))))
the deriving Logger via clause requires MonadIO instances for Field and MonadReader.
It might happen that a user is forced to define orphan instances for newtypes like MonadReader for type-classes that where not anticipated in this package. This may be unavoidable. However, we should make sure to systematically provide instances for a set of select common type-classes for all newtypes defined in this package.
E.g. in the following code
the
deriving Logger via
clause requiresMonadIO
instances forField
andMonadReader
.It might happen that a user is forced to define orphan instances for newtypes like
MonadReader
for type-classes that where not anticipated in this package. This may be unavoidable. However, we should make sure to systematically provide instances for a set of select common type-classes for all newtypes defined in this package.See #4 (comment)
The text was updated successfully, but these errors were encountered: