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
1
vote
0 answers

How to unit test a component's query evaluation in purescript-halogen?

A purescript-halogen component has an eval function defining how it evaluates queries. I'd like to write tests to cover the behaviour of the component; how would I go about doing this? For instance, if my component has GetValue in its query algebra,…
Paul Hendry
  • 76
  • 1
  • 4
1
vote
1 answer

Purescript Halogen: can I request the state of child component that is also a parent?

If I have a grandparent, a child component, and a grandchild component, can the grandparent request the state of the child? I've tried using "request" like here but the types don't match up when you're requesting the state of a child that also has a…
sportanova
  • 125
  • 3
  • 8
0
votes
0 answers

Halogen Ace example throws a ReferenceError

I downloaded prescript-halogen-6.1.3 and I tried to run the Ace example. When I open the index.html file I get a ReferenceError in the browser: ReferenceError: Can't find variable: require
0
votes
1 answer

No type class instance error when trying to lift Aff response

I am a newbie to Purescript and am trying to learn Halogen/Aff. I have been working on a simple app which is a variation of the effects-aff-ajax example in the purescript-halogen repo. I have everything almost working, except I get the error…
brown131
  • 11
  • 2
0
votes
1 answer

purescript halogen: Append IProp to HTML

Is there a way to append IProp's to HTML? Here's an example of what i'm trying to do: foo :: forall p i. H.HTML p i -> H.HTML p i foo myElement = addProp (HP.id_ "SomeId") myElement Where addProp takes myElement, gives it the Id (or any other…
Vance Palacio
  • 1,280
  • 12
  • 17
0
votes
1 answer

PureScript Halogen coordinates of the element on the page

How do I get the coordinates of the element itself on the page that triggered this event when I hover over it? In purescript there is an opportunity to take page, screen and client coordinates. Is it possible to know the coordinates of the element…
0
votes
2 answers

Purescript Halogen Component, Input vs State

I want to make a Halogen Component where the component's input differs from its state. According to the guide for Halogen (https://github.com/slamdata/purescript-halogen/blob/master/docs/5%20-%20Parent%20and%20child%20components.md#input-values)…
0
votes
1 answer

How to create a stateless and static Halogen component?

Consider this snippet from github, https://github.com/slamdata/purescript-halogen/blob/master/examples/basic/src/Button.purs#L42 which tries to render an html button using halogen library. render :: State -> H.ComponentHTML Query render state = …
mithocondria
  • 101
  • 4
0
votes
2 answers

throwError in Halogen component queries

I'm struggling with achieving following goal: I have the API requests typed in a manner that they return either a desired value, or an error when the status code wasn't indicating success, or when the auth token has been invalid etc: Either String…
Bartosz
  • 3,318
  • 21
  • 31
0
votes
1 answer

Purescript Halogen DeepPeek Child Instead of Grandchild

I'm trying to adapt this example https://github.com/slamdata/purescript-halogen/blob/v0.12.0/examples/deep-peek/src/Main.purs#L58 (relevant part copied below), but instead of peeking the grandchild I just want to peek the child, or in this case…
sportanova
  • 125
  • 3
  • 8
0
votes
1 answer

Is it possible to render a component during eval in halogen?

In my halogen project have this eval branch: eval (SetTest tName next) = do H.set (State Nothing) detail <- H.fromAff $ toAff settings $ getTestsByTestname (tName ^. unTestName) H.set (State (Just detail)) pure next The…
Ben Ford
  • 2,087
  • 21
  • 26
0
votes
1 answer

Is it possible to run something in Eff in a halogen ComponentHTML funcion?

There are a couple of bindings to moment.js I'd like to use for rendering time spans in my Halogen UI which have types something like diffMins :: forall eff. Moment -> Moment -> Eff (now :: NOW | eff) Number If I want to use this function in my UI…
Ben Ford
  • 2,087
  • 21
  • 26
0
votes
1 answer

Purescript Halogen Input Element and Custom Autocorrect Property

I'm trying to disable autocorrect in inputs for safari on iOS. There isn't currently an "autocorrect" property in purescript halogen, so I created one, and modified the indexed input element record to use it. My problem is that the new property…
sportanova
  • 125
  • 3
  • 8
0
votes
1 answer

Purescript Halogen Component function: Passing spaced arguments instead of a Record?

I'm on PureScript 0.8.2. In PureScript Halogen, the component function has the signature: component :: forall s f g. ComponentSpec s f g -> Component s f g where -- | A spec for a component. type ComponentSpec s f g = { render :: s ->…
RAbraham
  • 5,956
  • 8
  • 45
  • 80
0
votes
1 answer

Use purescript-halogen (with pulp)

Following PureScript by Example, I'm using pulp for installing packages. Halogen requires virtual-dom as extra dependency. From the documentation and the example packages, it seems to me that adding it involves a bunch of build tools that I haven't…
András Kovács
  • 29,931
  • 3
  • 53
  • 99
1 2
3