[Haskell-cafe] adding state in GUIs (qtHaskell)

Michael P Mossey mpm at alumni.caltech.edu
Wed Sep 9 21:29:33 EDT 2009


I'm trying to learn qtHaskell. I realize few people on this list know anything 
about qtHaskell, but I have a question that probably relates to all GUIs as 
implemented in Haskell. I just need a hint that could help me figure out the 
next step, which I might be able to infer from the qtHaskell API.

I don't think is any tutorial-type or step-by-step type documentation for 
qtHaskell. I have sent some questions to the author of qtHaskell, David Harley, 
but he hasn't responded yet, and anyway I don't want to trouble him every time I 
have a question, so I'm trying to infer as much as I can.

The problem relates to state. In Qt, one adds state to a widget by subclassing 
it and adding new member variables. For example, I want to create a widget that 
responds to keypresses and remembers what keypresses have taken place.

I'm totally stuck on this part, because Haskell doesn't have state. There must 
be some kind of Haskell call that adds state to a widget, but it is hard to 
figure out from the qtHaskell examples David provides.

Thanks,
Mike


More information about the Haskell-Cafe mailing list