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
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
2 answers

Could not deduce (Reflex t0) arising from a use of ‘never’

Anyone knows how I could deal with errors like `Could not deduce (Reflex t0) arising from a use of ‘never’? I am refactoring a portion of an app, which means a few never events don't get used, but since they are never to begin with, I don't…
Wizek
  • 4,854
  • 2
  • 25
  • 52
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
2
votes
1 answer

What can I do to eliminate the unsafePerformIO in this Reflex.Dom code?

main = mainWidget $ el "div" $ do let fileInputConfig = FileInputConfig (constDyn Map.empty) fi <- fileInput fileInputConfig let uploads :: Dynamic t [File] = value fi upload :: Dynamic t (Maybe File) <-…
John
  • 14,944
  • 12
  • 57
  • 57
2
votes
1 answer

Installing reflex-dom likely to break ghcjs

I am trying to install reflex and reflex-dom using cabal install I got the following error messages: $ cabal install reflex-dom ... cabal: The following packages are likely to be broken by the…
john mangual
  • 7,718
  • 13
  • 56
  • 95
2
votes
1 answer

Acess a servant server with a reflex-dom client

I'm using version 0.4 of reflex-dom and I have a tiny reflex-dom client: {-# LANGUAGE OverloadedStrings #-} import Reflex.Dom import qualified Data.Text as T import Data.Monoid main :: IO () main = mainWidget body body :: MonadWidget t m => m…
Jogger
  • 1,617
  • 2
  • 12
  • 22
2
votes
1 answer

How can I efficiently branch on the value inside a Reflex.Dynamic?

Let's say I have some application state, maintained on some backend system. It looks like this data MyState = State1 MyState1 | State2 MyState2 data MyState1 = MyState1 { ms1_text :: Text, ms1_int :: Int } data MyState2 = MyState2 { ms2_bool ::…
ajp
  • 1,723
  • 14
  • 22
2
votes
1 answer

How can I branch on the value inside a Reflex Dynamic?

in the simplest case, say I have a Dynamic t Bool, and when the value is true, I want a single empty div to exist, and when the value is false, I don't want there to be any dom element. slightly more generally, if I have a Dynamic t (Either MyA…
ajp
  • 1,723
  • 14
  • 22
2
votes
1 answer

How do you define a Haskell typeclass with a type that cannot be deduced?

I'm using the Reflex.Dom library, which defines a set of functions for creating HTML DOM elements el creates an element el' creates and returns an element elAttr creates an element with the given attributes elAttr' creates and returns an element…
alltom
  • 3,162
  • 4
  • 31
  • 47
2
votes
0 answers

Haskell Reflex: type error on Strings

I'm working through the reflex-frp examples on the github page and got stuck on the Dynamics and Events section. I try to use ghcjs to compile the following code: {-# LANGUAGE OverloadedStrings #-} import Reflex import Reflex.Dom main = mainWidget…
Chandler Squires
  • 397
  • 3
  • 7
  • 22
2
votes
0 answers

How do you create a dynamic canvas from an image in Haskell's Reflex lib?

I am representing an image as: data Image = Image { size :: V2 Int, buffer :: UVector.Vector Word32 } That is, a row-major unboxed array of RGBA Word32 pixels. That format is the same used by JavaScript's Canvas's ImageData. You could blit such a…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
1
vote
1 answer

Convert ID2D1Device1 to ID3D11Device

I want to implement NVIDIA Reflex to My Direct2D application. I have a ID2D11Device, but NvAPI_D3D_SetSleepMode requires Direct3DDevice. I know that Direct2D is based on Direct3D. So, I think that I can acquire Direct3D Device from Direct2D Device.…
P. ful
  • 113
  • 9
1
vote
1 answer

Trailing context match EOF flex-lexer

I want to match these two tokens: 1. NUM: A series of characters in [0-9_] with an optional . in between. 2. ID: A series of characters in [a-zA-Z0-9_] with at-least one [a-zA-Z] character. Flex rules for these will…
Sourav Kannantha B
  • 2,860
  • 1
  • 11
  • 35