mtth / tracing

Distributed tracing
https://hackage.haskell.org/package/tracing
BSD 3-Clause "New" or "Revised" License
24 stars 11 forks source link

Derive more #2

Open serras opened 4 years ago

serras commented 4 years ago

This PR adds more auto-derivable classes to TraceT. These have proved to be useful when using tracing as part of the Mu microservice library.

serras commented 4 years ago

I have pushed a second commit moving from unliftio to monad-control. This makes the library more powerful at almost zero cost, since more types implement MonadBaseControl IO than UnliftIO. In particular, we had a case in which we required the former because of an ExceptT layer in the stack.

serras commented 4 years ago

Since we really needed these changes, we have published a fork in Hackage. Sorry for any inconvenience, but otherwise we could not move forward with our project :(

mtth commented 3 years ago

Thanks for the PR @serras and apologies for the slow reply, I am just catching up on this repo. I don't think I had notifications turned on here. It looks like your PR now includes the fork changes, let me know if you are still interested in merging parts of it.

serras commented 3 years ago

I would be happy to prepare a new PR. A question remains, though: this library uses unliftio, whereas I needed support for monad-control. Does it make sense to have everything in one single place, or would people dislike having both dependencies from a single library?

mtth commented 3 years ago

It would be great if users could pick only the one they are interested in. I'm not an expert in Haskell tooling though, do you know any good options to support this?

serras commented 3 years ago

In theory there is now support for multiple public libraries in a single package, so people could depend on tracing:control. However, you need a recent version of Cabal, and there is no support for it in Stack, so I don't think that's a good option.

coderfromhere commented 3 years ago

Isn't monad-control more generic implementation of the same pattern? it seems there's also a way to express the current unliftio signatures through monad-control if needed - https://lexi-lambda.github.io/blog/2019/09/07/demystifying-monadbasecontrol/#relationship-to-monadunliftio

serras commented 3 years ago

Yes, that's true. But often you want to use only one of those, because they come with their own "ecosystem" of surrounding libraries. I think many people would dislike a library if it depended on both monad-control and unliftio.