hexresearch / hschain

Other
4 stars 0 forks source link

Example on using DerivingVia to derive instances for app monad #621

Closed Shimuuar closed 4 years ago

Shimuuar commented 4 years ago

PR provides newtypes which allow to define MonadLogger, MonadTMMonitoring etc from monad that has MonadReader instance. But in order to lift accessors to type level generic-lens is required. Oter that that arguments in MonadReadDB/MonadDB were flipped in order to make deriving instances for them work

At the moment I'm not sure whether merging it a good idea overall

Shimuuar commented 4 years ago

This approach works quite well and allows to define MonadLogger/MonadQuery separately. Merging