* Magicloud Magiclouds <magicloud.magiclouds@gmail.com> [2014-07-28 13:46:53+0800]
> Hi,GHC has to store some MonadIO dictionary in the existential type, but it cannot
>
> For code like below, how to make it compilable?
>
> data EventHandlers = forall m. MonadIO m => EventHandlers { onDeleteWindow
> :: Maybe (m ()) }
> instance Default EventHandlers where
> def = EventHandlers Nothing
figure out which dictionary to store (it can be any).
You can tell it which one to use by supplying a type annotation, e.g.:
def = EventHandlers (Nothing :: Maybe (IO ()))
Roman