Questions tagged [halogen]

Use for questions regarding purescript-halogen, a UI library for [purescript]

Halogen is a library and framework for user interaction and other aspects of web applications.

Resources

45 questions
2
votes
1 answer

Purescript Halogen manually trigger input validation outside of a form

I have input fields which I have marked with a required attribute, but can't figure out a way to trigger a validation check (I am not working inside of a form, so using a default submit button action won't work for me). A quick pursuit search shows…
Sandoichi
  • 254
  • 5
  • 14
2
votes
0 answers

Is there a way to match a fragment identifier (hash fragment) from a URL with purescript-routing?

Is it possible to match on a url route that has a hash fragment at the end of it such as example.com/examplePath#field1=value&field2=anotherValue using the purescript-routing library? This is with the intent to be able to get a Map String String…
chups
  • 53
  • 5
2
votes
1 answer

In purescript-dom how do you go from a Node to a specific element type?

I think I might be missing a key function in the purescript-dom module to convert from a Node to a specific element type. For instance if I have a Event, I can use DOM.Events.Events.target to get the Node, but it seems like the only way to get a…
Albtzrly
  • 924
  • 1
  • 6
  • 15
2
votes
1 answer

Purescript: Halogen HTML DSL only Renders "id" tags

I'm using purescript-halogen v0.12.0, and I can't figure out why only the id tag is rendering. This occurs even with supposedly well supported elements, like div. Example: render = div [ id_ "some-id", name "some-name ] [] A div will be created, but…
2
votes
1 answer

Selecting Elements By Id in Purescript

Is there a function in purescript-halogen to select an element by it's id, or do I need to custom role it (which would seem very strange to me). I'm reading through the documentation on Pursuit, and I see a selectElement function in Util, but…
2
votes
1 answer

Purescript Halogen Handling SVG

Is there an accessible way to utilize svg elements in purescript halogen? I'm trying to draw a dynamic, clickable, graph within an , but the only reference I can find to svg is in Halogen.Themes.Bootstrap, which seems to be more concerned with…
clo_jur
  • 1,359
  • 1
  • 11
  • 27
2
votes
1 answer

Monad Transformer for Halogen Components

I'm trying to figure out in which way I can use a transformer on the monad that a Halogen component contains. I'd like to extend the intro example by a ReaderT that carries a Config record which in this case could be used to make the strings…
passy
  • 7,170
  • 5
  • 36
  • 38
1
vote
1 answer

PureScript Halogen How to create an event which fires every frame?

I need to do specific animation in Halogen.Each frame should be asked to update the state in order to properly draw each step. Is there any subscription mechanism for such cases? I tried to use FRP.Event.TIme, but I do not understand how to raise…
1
vote
1 answer

Get current base URL for web page

I am running a PureScript app that is being served up by a backend Suave application in F#. In the front end, I need to open a WebSocket connection in PureScript to the backend, but part of the path needs to be dynamic based on how the backend app…
Sandoichi
  • 254
  • 5
  • 14
1
vote
1 answer

EscapedSkolem error implementing websocket reconnection in PureScript and Halogen

I'm trying to implement Websocket reconnection in PureScript and am at a complete loss at how to proceed. I've added the reconnection code at the top level due to the use of Aff; I think this is the correct place but I'm not sure. I've tried to…
filterfish
  • 25
  • 6
1
vote
1 answer

Editing and running Halogen applications from pulp psci

I am working on a small Purescript application that produces visualizations. My architecture is a bit non-traditional, however, and I'm having some issues. Here's what I want: Launch pulp psci -- --port 8080 and connect with a browser Call a…
Karl
  • 1,143
  • 6
  • 20
1
vote
0 answers

Handling 3rd party DOM modifications with Halogen

I'm using MDL lite with Halogen. MDL relies mostly on CSS, but it adds some JS for various features. This has the unfortunate consequences when used with VDom approach. For example, the textfield applies is-dirty class after input had been modified…
Bartosz
  • 3,318
  • 21
  • 31
1
vote
1 answer

Purescript Halogen: Defining Custom HTML Elements

I'm having difficulties similar to this unanswered question: Purescript: Halogen HTML DSL only Renders "id" tags I'm trying to define a new HTML element. In particular, I would like to display an svg elem and image element with some new tags, like…
clo_jur
  • 1,359
  • 1
  • 11
  • 27
1
vote
1 answer

purescript-halogen: modify state by effectful computation

I want to modify my state with a function that depends on the old state, but also introduces some randomness. My function f looks like this: f :: State -> Eff (random :: RANDOM) State I guess my state should be pure, and I had no idea how to get…
stholzm
  • 3,395
  • 19
  • 31
1
vote
1 answer

Purescript Halogen, side effect (random number)

In a PureScript Halogen project, I would like to set the state to a random number, but how do I extract the value? The normal r <- randomInt 1 10 does not compile when it's inside the eval function. module Main where import Prelude import…
crazhyouse
  • 13
  • 2