3 ms·
The capability pattern that Data Has implements is definitely used in other projects[1], and notably is endorsed by RIO[2]. [1]https://github.com/input-output-
by jeremyjh 7y ago
The capability pattern that Data Has implements is definitely used in other projects[1], and notably is endorsed by RIO[2].
[1]https://github.com/input-output-hk/cardano-sl https://github.com/input-output-hk/cardano-sl
[2]https://github.com/commercialhaskell/rio#monads https://github.com/commercialhaskell/rio#monads
Elaboration:
https://www.parsonsmatt.org/2018/03/22/three_layer_haskell_cake.html https://www.parsonsmatt.org/2018/03/22/three_layer_haskell_c...
- Mathnerd314 7y agoThe GitHub issue I linked is basically "switch from data-has to RIO"; the issues with data-has come from its use of multi-parameter type classes. RIO avoids the issues by using single-parameter classes. AFAICT multi-parameter type classes are the subject of numerous GHC bugs/misfeatures and are best avoided in production.
- jeremyjh 7y agoMagicBane already uses RIO. RIO doesn't specify anything about the capabilities model its just a pattern. As noted in the ticket, the nice thing about Data Has is it already has instances for tuples. This is really handy in - for example - init code where you may want to have logging and config capabilities before the rest of your env is setup. But I agree its probably not worth the cost and the single parameter pattern is better.