Questions tagged [threepenny-gui]

Threepenny is a Haskell GUI framework that uses the web browser as a display. It is designed for easy setup across different operating systems. Threepenny includes built-in support for functional reactive programming (FRP).

55 questions
1
vote
1 answer

Monad: [UI Element] vs [Element]

In the following code sample i tried to create a box with a number of select elements and combine their selection into a list of values using behaviors. (code compiles/runs in ghci with just threepenny-gui) {-# LANGUAGE RecursiveDo #-} module…
1
vote
1 answer

How to obtain the string value of an Element?

I want to do something like this: getValue :: Element -> String getValue x = do v <- get UI.value x v However, an error is thrown; the expected type of get UI.value x is [String] but the actual type is UI String? But if I change the type…
allidoiswin
  • 2,543
  • 1
  • 20
  • 23
1
vote
1 answer

How to read data from a table in threepenny-gui?

Let's say I want every to be an object, with its children to be the fields of that object. So I'm looking for something like this: getListFromTable :: Window -> Element -> [Thing] getListFromTable w table = do rows <-…
allidoiswin
  • 2,543
  • 1
  • 20
  • 23
1
vote
1 answer

How to reload updated file in Threepenny-gui 0.6?

The Threepenny-gui changelog (https://hackage.haskell.org/package/threepenny-gui-0.6.0.1/changelog) reads: "The functions loadFile and loadDirectory have been removed, as I felt that the jsStatic option is sufficient for most use cases." My question…
Maarten Faddegon
  • 775
  • 5
  • 11
1
vote
0 answers

Using FRP and IORef in threepenny-gui

I have a little example using IORef in threepenny-gui (TPG): testIORef :: IORef String -> Window -> UI () testIORef ref window = void $ do return window # set title "Test IORef" inCell <- UI.input outCell <- UI.input -- When value…
b1g3ar5
  • 335
  • 2
  • 9
1
vote
2 answers

Using IORef in threepenny gui

I'm trying to set an IORef in threepenny-gui but I can't get it to work. In my app the IORef itself will be more complicated and not itself be displayed - but this example demonstrates the problem I think. Here is my try: testIORef2 :: IORef String…
b1g3ar5
  • 335
  • 2
  • 9
1
vote
1 answer

Accumulating events with a resettable initial value

I need a function like accumB, but I would like the initial value to be a Behavior instead of a constant. When the initial value changes, the accumulator should 'reset' and start accumulating from that value. Concretely, for the following code and…
int3
  • 12,861
  • 8
  • 51
  • 80
1
vote
1 answer

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…
haroldcarr
  • 1,523
  • 15
  • 17
0
votes
0 answers

How can I compile an existing project of Haskell that has threepenny-gui library on windows?

threepenny-gui: GUI framework that uses the web browser as a display.
0
votes
1 answer

Getting Errors when trying to test threepenny-gui

i want to try out the threepenny-gui package for haskell. So i run cabal install threepenny-gui ... without any problems So i tried the following example: module Main where import qualified Graphics.UI.Threepenny as UI import …
Xlaech
  • 456
  • 3
  • 19
1 2 3
4