Questions tagged [reflex]

Reflex is a Haskell library, providing high-performance, deterministic, higher-order Functional Reactive Programming system

Reflex is a Haskell library, providing high-performance, deterministic, higher-order Functional Reactive Programming system

74 questions
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…
3
votes
2 answers

With Reflex.GI.Gtk, how to use and force evaluation of a dynamic from within an event

When using reflex-gi-gtk-0.2.0.0 I can access a dynamic from within an event: submitButtonE4 <- eventOnSignal submitButton #clicked ( do let processDyn dynCompany = do case dynCompany of …
3
votes
0 answers

How to get the global keydown event in Reflex?

My current attempt at getting an event of global keypress (eg: user hits a keyboard shortcut, from anywhere in the UI, to trigger opening of modal dialog) is: prerender_ blank $ do -- ctx <- askJSM doc <- currentDocumentUnchecked win…
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
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
1 answer

How can I use ghci with my reflex project using only stack.yaml?

I've removed nix from my reflex project, having replaced it with stack. Everything is good, except being able to use the repl. I've tried to create a minimal reflex project to demonstrate what I have tried, and the errors my attempt…
user1198582
3
votes
1 answer

(How) is it possible to have polymorphic values in a `dependent-map` GADT?

Anyone knows how/if it's possible to extend the Foo GADT in this code: {-# language GADTs #-} {-# language DeriveGeneric #-} {-# language DeriveAnyClass #-} {-# language TemplateHaskell #-} {-# language StandaloneDeriving #-} import Prelude …
Wizek
  • 4,854
  • 2
  • 25
  • 52
3
votes
1 answer

Using Reflex Platform to compile a stack project with local packages

I would like to use the work-on script in reflex-platform to compile a project that has been managed using stack until now as explained here. In the stack.yaml's package list I have a reference to a package located in a local path, something…
Jesuspc
  • 1,664
  • 10
  • 25
3
votes
1 answer

How to get a DoubleClicked event from a reflex-dom listbox

The following code displays a reflex-dom dropdown element visually as a listbox and displays at the bottom always the last selected (clicked) line. {-# LANGUAGE OverloadedStrings #-} import Reflex.Dom import qualified Data.Text as T import…
Jogger
  • 1,617
  • 2
  • 12
  • 22
3
votes
2 answers

ReflexFRP: How to set button text from textInput on button click

I have a simple widget that should set the "text" of a button from a given text input field. While I managed to do a simple clear functionality buttonWidget :: MonadWidget t m => m () buttonWidget = do send <- button "clear" input <- textInput…
epsilonhalbe
  • 15,637
  • 5
  • 46
  • 74
3
votes
1 answer

Representing timestamps

I would like to represent the timestamp coming from an HTMLMediaElement. Its defining characteristics are: Its value is represented as a Double It can be queried at any time using getCurrentTime :: IO Double (as partially applied on a given…
Cactus
  • 27,075
  • 9
  • 69
  • 149
2
votes
1 answer

Haskell GHCJS with Diagrams gives error: no C compiler provided for this platform

I am trying to build a POC, using Reflex and Diagrams. I am using WSL2 with Ubuntu-20.04. I've used the Reflex-stone template, which builds fine. I then add diagrams-lib to the dependency list, and get this…
Chris Wohlert
  • 610
  • 3
  • 12
2
votes
1 answer

Custom stimulus reflex class

I am working on an experimental project in Rails 6. The purpose of this project for me is to learn new methodologies & play with new("ish") technologies. In short, I am playing around with the Trailblazer infrastructure, stimulus_reflex &…
HermannHH
  • 1,732
  • 1
  • 27
  • 57
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