Integrating Effectful and Persistent

17 Likes

Thanks for the writeup :+1: I agree with the approach, defining an effect with a “WIP” API is definitely sufficient if you just want to try out a library.

Btw, you wrote

Because of the backend type parameter, the makeEffect Template Haskell macro won’t work

And I thought it must be a bug in effectful-th then, but tried out this piece of code:

data Persist backend :: Effect where
  LiftPersist :: ReaderT backend IO a -> Persist backend m a
makeEffect ''Persist

and it compiles fine :thinking:

1 Like

Thank you for pointing this out. It works over here too, so I’m not sure what I was doing wrong. Perhaps I was trying to apply the TH function to Persist backend.

I’ll push out a correction when my colleagues are back from Easter holidays and able to approve PRs.

1 Like