-
I am working on an application that requires binding to external C libraries. To be expected, the bound API works with raw I think the proper way to protect against this accidental sharing is to use an On the other hand, if I use dynamic effects (using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yes, if you use
It passes to
It does, the question is whether it actually matters. Benchmarks show that access to a state via MVar is about twice as slow than without it (dynamic/local vs dynamic/shared), but that's a microbenchmark, so take it with a grain of salt.
If you make a static effect with a custom relinker, you can use it in a |
Beta Was this translation helpful? Give feedback.
Yes, if you use
evalStaticRep
. But if you look at its definition:It passes to
consEnv
adummyRelinker
that does nothing. You can use this definition inline in your effect, but pass a custom relinker that will either make a copy of the data Ptr points or if you want to forbid cloning the effect, you can just use theerror
call in the relinker. That will just give you an er…