snoyberg / monad-logger

A class of monads which can log messages
MIT License
36 stars 22 forks source link

Make this package a wrapper for the code in rio #25

Open mpilgrem opened 4 years ago

mpilgrem commented 4 years ago

See the preference at comment.

I have been thinking about this topic. Where I am stuck, from the perspective of a 'wrapper', is that the logging functions in monad-logger have more general types than the ones in rio. For example:

class Monad m => MonadLogger m where ...

logWithoutLoc :: (MonadLogger m, ToLogStr msg) => LogSource -> LogLevel -> msg -> m ()

compared to:

class Monad m => MonadIO m where ...

logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> Utf8Builder -> m ()

MonadLogger m is not subject to the MonadIO m constraint.