I am trying to figure out how to use Haskell threepenny-gui with its reactive functionality to write a program that lets
- the user select an item from a listBox
- send the selection to an external server
- get back a list of results from the server
- populate the listBox with the results
- repeat
It seems I will need to use Handler
, newEvent
and register
to do the above. If someone could point me to some existing code that does something like the above that would be great.
The closest I have found is GameThing.hs
in the threepenny-gui samples
directory (but it doesn't use register
).
UPDATE:
I am asking whether I should be using Handler
, newEvent
and register
--- and, if so, some clarification or example of those functions.
Also, to be clear, the big picture is:
browser --> threepenny-gui (on localhost) --> backend server (anywhere on network)
<-- <--
In other words, I need to do some IO (based on user selection) then display the results of that IO.
UPDATE: here is my solution (based on @Taldykin's response): https://github.com/haroldcarr/rdf-triple-browser/tree/master/haskell/src