mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Bring back HasNakadiConfig using Functional Dependencies and simplify MonadNakadi typeclass #74

Closed mtesseract closed 6 years ago

mtesseract commented 6 years ago

73

Define HasNakadiConfig typeclass using simplified interface and using functional dependencies.

Simplify MonadNakadi typeclass significantly. What nakadi-client itself only needs is a way to obtain the Nakadi configuration. The other functionality that was inspired by ReaderT is not required within the library itself.

If a user needs this functionality (e.g., local), ReaderT together with the standard functions can be used.

Add test, which uses the MonadNakadi instance for ReaderT.

mtesseract commented 6 years ago

@etorreborre Here is a simplification that I had in my pipeline. :-)

I had only understood recently that using functional dependencies allows for saving the previous HasNakadiConfig mechanism.

etorreborre commented 6 years ago

Indeed that's simpler, 👍. I need some to read this a bit better some day: https://web.cecs.pdx.edu/~mpj/pubs/fundeps-esop2000.pdf.