[ANN] lazy-scope - ST-like IO Handle and lazy ByteString

  1. with -fcore, this depends only on unliftio-core which is a pretty minimal dependency footprint
  2. it’s made exactly for this usecase: library authors that want to allow safe usages of resources. There’s no “extra” API overhead.
1 Like

I see, so it’s more lightweight in terms of dependencies. Of the bluefin-internal dependencies

  • async is essential for connecting Streams to Consumers. I guess I could chop out the bits I need from async and inline them in bluefin-internal
  • base is base
  • monad-control is needed so I can provide a MonadControl instance
  • transformers is used for ReaderT
  • transformers-base is needed so I can provide a MonadBase instance
  • unliftio-core is needed so I can provide a MonadUnliftIO instance

I’m not sure how useful MonadControl or MonadBase are; I’ve never used them. I only provide them because I was copying what effectful provides. Since you don’t have them for scoped-codensity then perhaps Bluefin doesn’t need them either.

I’m dubious whether depending on transformers to Reader is worthwhile: it’s a boot library, so always available, but it’s easy to reimplement and in the end I probably don’t need it anyway.


Bluefin is also made exactly for this use case (it just turns out the notion of “resource” is wider than one might originally think). What is the “extra” API overhead you’re thinking of?

1 Like

Well… it’s an effect system. Sure it abstractly fits the notion just like you explained…

I guess part of my point is just that my library is meant to be used for this purpose and this purpose only.

Also to be very clear, this is not a criticism against bluefin

1 Like

So by “extra” API do you mean the resources it provides by default, like State and Exception?

That’s one way of looking at it!

That’s fine, I’m just wondering why being single-purpose is a benefit.

That’s OK, I didn’t take it as one. I’m just trying to understand what are the desirable goals you’re promoting. If there’s something that Bluefin’s missing that would help people then I’d like to add it. (On the other hand, if the problem is the opposite – that it’s too big – then there’s not much I can do about that.)