hungryjoe,
@hungryjoe@functional.cafe avatar

Anyone up for giving me feedback on a api design problem?
https://github.com/joe-warren/opencascade-hs/issues/3

Yuras,

@hungryjoe If Acquire is a problem, why don't use finalizers to release memory? I know, you explicitly wrote that you don't want Ptr, but I don't understand why.

hungryjoe,
@hungryjoe@functional.cafe avatar

@Yuras I did eventually refactor this to use finalizers (Keeping Acquire, but only under the hood)
https://github.com/joe-warren/opencascade-hs/pull/4

So far it seems to have worked fairly well
So thanks for the nudge

hungryjoe,
@hungryjoe@functional.cafe avatar

@Yuras most of the OpenCascade functions can return errors, and it's quite nice to be able to control where those happen

Yuras,

@hungryjoe ah, I see now. I misread this part in the post.
So all these functions, like volume, are impure by design, so you need a monad there anyway. And the question has nothing to do with Acquire per ser, you just happen to have this monad already.
In this case, as a hypothetical user of the library, I'd prefer Monad/Applicative and do-notation. Again, you explicitly wrote that you don't want it. Why?

hungryjoe,
@hungryjoe@functional.cafe avatar

@Yuras because the bulk of the operations are things like union and intersection where you'd just constantly be lifting them

hungryjoe,
@hungryjoe@functional.cafe avatar

@Yuras see the someComposite example in the issue

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • DreamBathrooms
  • InstantRegret
  • osvaldo12
  • magazineikmin
  • mdbf
  • rosin
  • Youngstown
  • thenastyranch
  • slotface
  • cisconetworking
  • khanakhh
  • kavyap
  • ngwrru68w68
  • ethstaker
  • JUstTest
  • everett
  • modclub
  • cubers
  • Durango
  • anitta
  • tester
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • megavids
  • Leos
  • provamag3
  • lostlight
  • All magazines