[Haskell-cafe] more gtk help
claude at mathr.co.uk
Mon Aug 12 15:50:43 CEST 2013
On 12/08/13 03:52, briand at aracnet.com wrote:
> Couldn't match expected type
> Gtk.on Gtk.exposeEvent glCanvas $ \ _ -> putStrLn "foo"
> I looked up the type of Gtk.on and exposeEvent :
> :: object
> -> Signal object callback -> callback -> IO (ConnectId object)
I think you have the arguments flipped, try:
Gtk.on glCanvas Gtk.exposeEvent $ \_ -> ...
As for explaining the types - as I understand it, you have an object and
a callback, and the Signal associates the object with the callback for a
specific event type. The type variables occur more than once in the
whole type for safety: the right type of callback must be provided for
the event type, and the object must support the event type too.
More information about the Haskell-Cafe