天道酬勤,学无止境

threepenny-gui

using threepenny-gui/reactive in client/server programming

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

2021-06-12 06:51:08    分类:问答    haskell   threepenny-gui

Dynamic Elements based on Behaviour in threepenny-gui

To put it simple, I am looking for a way to display a Behaviour (UI Element). My actual use-case is displaying a table, which can be filtered. So I have a function tableElement :: String -> UI Element (the String parameter being the filter condition) and an input field filterElement :: Element, which represents the filter. The most natural way for me to combine these would be something like this: bFilter <- stepper "" (valueChange filterElement) displaySomehow (fmap tableElement bFilter) This is also the way it is done in Elm. The closest thing I have found so far is using sink children, but

2021-06-10 03:04:53    分类:问答    haskell   frp   threepenny-gui