[Haskell-cafe] Dynamic types through unsafeCoerce
alfonso.acosta at gmail.com
Wed Dec 13 12:31:07 EST 2006
On 12/13/06, Taral <taralx at gmail.com> wrote:
> On 12/13/06, Alfonso Acosta <alfonso.acosta at gmail.com> wrote:
> > deactivate :: Maybe(hd -> IO ()),
> According to the spec, NULL here means no-op. So instead of using
> Maybe, just set deactivate = \_ -> return () if you see NULL.
I considered this solution as well, but is not really acceptable cause
the function would be called anyway (which would harm performance).
Furthermore is not sematically correct as externally the descriptor
would be viewed as having a deactivate.
More information about the Haskell-Cafe