3 ms·
You can pretty easily extend this with `mtl` in Haskell genericInjected :: MonadReader Handle m => m () If you use lenses you can express an even nicer pa
by tel 12y ago
You can pretty easily extend this with `mtl` in Haskell
genericInjected :: MonadReader Handle m => m ()
If you use lenses you can express an even nicer pattern
genericInjected :: HasHandle Database m => m ()
Perhaps the king here is ML's functors
module ( Dbh : DatabaseHandle ) = struct
...
end
In all cases this isn't much more than "dependency passing", but there is clearly more "injectability" and encapsulation available. Ultimately it all comes down to the kind of typed interface you want to expose.