Reflex-DOM is a framework for building web applications in Haskell, based on the Functional Reactive Programming library Reflex.
Questions tagged [reflex-dom]
18 questions
4
votes
1 answer
How can I obtain a Dynamic Bool that corresponds to the mouse being over a certain element?
Suppose I have a button and a square, like this:
main = mainWidget $ do
x <- button "Change color."
y <- toggle False x
z <- mapDyn style y
elDynAttr "div" z blank
style :: Bool -> Map String String
style b | b = "style" =:…

Ignat Insarov
- 4,660
- 18
- 37
3
votes
2 answers
How to install ghcjs 8.8 or 8.10?
I would like to produce an HTML / JS page with reflex-dom (only client side, frontend).
However, I use the singletons package (2.6) and it seems that it cannot be compiled with ghcjs or ghc 8.6.5 (singletons 2.5.1, broken-unpatched). Therefore, the…

Ludovic Mignot
- 33
- 2
3
votes
1 answer
How to render Dynamic of list (`Dynamics t [a]`)?
I can draw element for Dynamic t Item but don't know how to draw element of Dynamic t [Item]
import Reflex.Dom
data ItemType
= Apple
| Banana
deriving (Eq, Show)
-- In the real-world, this function build complex DOM. Oversimplified here for…

wizzup
- 2,361
- 20
- 34
3
votes
1 answer
Where to put the css file when using obelisk
I want to make two div's float side by side using Obelisk. For this I used the information from this post, How to place div side by side and for this solution classes have to be declared in css. Following the advice of this tutorial…

Emiel Lanckriet
- 95
- 2
- 12
3
votes
0 answers
Using Web Component HTML tags with reflex
I try to use Web Components in Reflex. Code is as such:
buttonUI5 :: DomBuilder t m => T.Text -> m (Event t ())
buttonUI5 t = do
(e, _) <- element "ui5-button" def $ text t
return $ domEvent Click e
For ui5-button it worked as expected. Other…

Markus Kupke
- 31
- 2
3
votes
1 answer
Workarounds for Haskell / cabal packages with constraints with Nix and Cabal?
I recently got into developing with reflex-platform, with some extra configuration similar to what is described in the excellent reflex-project-skeleton.
Now I am having a package conflict that I am unable to resolve.
I use the same cabal script as…

RecencyEffect
- 736
- 7
- 18
2
votes
1 answer
Do I have to worry about a Dynamic firing even when the value does not change?
Using reflex-dom I found myself writing the following code:
dynShowNumbers <- holdDyn False $ catMaybes $ updated dynMaybeShowNumbers
where dynMaybeShowNumbers :: Dynamic t (Maybe Bool) fires, whenever a key is pressed or released, but it only has…

ruben.moor
- 1,876
- 15
- 27
2
votes
0 answers
Counter widget in Reflex-FRP
I am trying to make a counter widget in Reflex with the following qualities:
It has a minimum value of 0 -- and hitting "decrement" while at 0 results in nothing happening.
(solved) The increment button is to the right of the decrement button.
It…

LevelChart8
- 207
- 1
- 8
2
votes
0 answers
Context/signature mismatch when using dynamic functions in Reflex-DOM
I was able to get this dropdown compiling:
bodyElementPracticeType :: MonadWidget t m => m ()
bodyElementPracticeType = el "div" $ do
el "h2" $ text "Dropdown"
text "Select sport "
dd <- dropdown Solo_Workout (constDyn (Map.fromList [(e,…

LevelChart8
- 207
- 1
- 8
2
votes
1 answer
Reflex dropdown menu populated by sum type values
I am following this tutorial, from which the below example comes: https://github.com/hansroland/reflex-dom-inbits/blob/master/tutorial.md
bodyElement :: MonadWidget t m => m ()
bodyElement = el "div" $ do
el "h2" $ text "Dropdown"
text "Select…

LevelChart8
- 207
- 1
- 8
2
votes
1 answer
Staticfile error when using Ob and reflex to import CSS-file
I want to make two div's float side by side using Obelisk. For this I already asked this question (Where to put the css file when using obelisk). This provided the answer that I should put my stuff in static and add static @filename. However, this…

Emiel Lanckriet
- 95
- 2
- 12
2
votes
1 answer
how to debug reflex-dom programs-
So I just discovered this library and thought it might be awesome for building UI's. Here is a small exercise I tried to implement when learning this library. Basically it tries to open a directory on the local file system and displays all the files…

user2812201
- 437
- 3
- 7
2
votes
1 answer
Updating a record from a text input
relative Haskell and reflex noob here. Decided to get my feet wet with a real-world application.
I am having a problem with triggering an update to a Dynamic containing my record once the user enters text in a textInput.
The code compiles in GHCJS,…

RecencyEffect
- 736
- 7
- 18
0
votes
0 answers
Can't get out of recursive in reflex-dom
The code compiles but when run gets stuck in infinite recursive loop. It's not obvious where the loop enters, especially when using recursive do or monadfix. When trying to debug in the browser it finds cyclic evaluation in fixIO at rts.js line…

Marius Catalin
- 349
- 1
- 7
0
votes
1 answer
Sharing dynamic between frontend head and body
New to haskell, but I'm not sure that you can create a dynamic that can go into both head and body. I'd like to update page title.

janat08
- 1,725
- 2
- 16
- 27