wxcore documentation [1] says:
textCtrlGetSelection :: TextCtrl a -> Ptr b -> Ptr c -> IO ()
Is this correct? I assume b and c should be CInt.
[1] https://hackage.haskell.org/package/wxcore-0.92.3.0/docs/Graphics-UI-WXCore-WxcClassesMZ.html#v:textCtrlGetSelection
It seems that you are right. The function type is however automatically
generated by wxdirect, therefore an update for wxdirect is needed to get
the proper function type. (The lexer/parser does not recognize the C types long* and long& properly.)