regions icon indicating copy to clipboard operation
regions copied to clipboard

`base` dependency is too restrictive

Open ocharles opened this issue 11 years ago • 6 comments

ocharles avatar Oct 29 '14 11:10 ocharles

I try to make a new release when I have some time.

basvandijk avatar Oct 29 '14 12:10 basvandijk

:+1:

Is master usable atm? I'm mostly looking to see if regions is a good fit for some work I'm doing.

ocharles avatar Oct 29 '14 12:10 ocharles

Yes master should be usable.

However, I haven't updated all its reverse dependencies yet.

What are you thinking to use regions for, if I may ask?

basvandijk avatar Oct 29 '14 15:10 basvandijk

Ah, gotcha.

Over at @haskell-game we're trying to get a decent mid/high-level API written for the SDL2 graphics library. We're a good way there, but we need a good story around handling of scarce resources. Finalizers don't cut it, because even though something is no longer lexically in scope, it's still operationally in scope via OpenGL's massive state machine (or various other state machines). It seems that if we want automatic memory management, regions are going to be the way to go.

I prefer regions over resourcet, because there's considerably less scope to shoot yourself in the foot :)

ocharles avatar Oct 29 '14 15:10 ocharles

Another more restrictive but simpler library might be Gabriel Gonzalez's managed library.

I'll try to make a release of regions sometime this week so you can more easily work with it.

basvandijk avatar Oct 29 '14 16:10 basvandijk

managed is nice, but it has the same problem most other naive regions-like libraries have - you can't interleave operations. The key benefit of lightweight monadic regions is the ability to duplicate something into another scope. But then, you already know this as you wrote the library :)

ocharles avatar Oct 29 '14 16:10 ocharles