[Haskell-cafe] Re: ANN: Elerea, another FRP library
Wolfgang Jeltsch
g9ks157k at acme.softbase.org
Wed Apr 15 07:21:15 EDT 2009
Am Mittwoch, 15. April 2009 09:03 schrieb Achim Schneider:
> I don't think using dirty tricks to implement FRP deserves flak, at
> all, from my POV, it sounds like complaining that the IO monad is
> implemented using C... meaning that if you're that close to bare
> thunks, you have every right to use any means necessary to make them
> behave properly.
It depends. Using unsafe stuff internally, might be acceptable and sometimes
necessary. I also use unsafePerformIO in Grapefruit for implementing CSignals
although I’m not very comfortable with this.
On the other hand, breaking referential transparency in the external interface
is a very bad idea, in my opinion. Actually, this means that the library user
would have to turn certain compiler optimizations off to get the intended
behavior. Just have a look at the Haddock docs of unsafePerformIO. In my
earlier years of Haskell programming, I thought that unsafePerformIO is not
too bad but I had to discover that it can quickly lead to a catastrophe.
Best wishes,
Wolfgang
More information about the Haskell-Cafe
mailing list