Questions tagged [elm]

Elm is a functional programming language for writing web applications that can fully replace, or interoperate with, HTML/CSS/JavaScript.

Elm is a functional programming language that is interoperable with HTML/CSS/JavaScript. It is optimized for creating web UIs, supporting complex user input without using callbacks.

Key features

  • Static types with type inference, with the best compiler errors ever
  • No runtime exceptions
  • No null or undefined in the language
  • Enforces semver for all Elm packages (you must update version number if you make a breaking change)

Resources:

Elm Books

1885 questions
1
vote
1 answer

Cannot reach elm Tick action

I'm hoping someone might be able to help me out here with Signals and Effects. I'm looking into Signals/Effects and have been studying the-elm-architecture, particularly example 8. In this example (as I understand it), if you click on the shape(s)…
Denim Demon
  • 734
  • 1
  • 10
  • 23
1
vote
1 answer

elm-architecture separate signal handling?

I can't find an example anywhere online that answers the question: how does a parent component respond to different actions coming out of a child module? Consider a simple chat message input with a submit button: // child component: text input w/ a…
Clev3r
  • 1,568
  • 1
  • 15
  • 28
1
vote
1 answer

Executing native functions/javascript as part of the view function

I'm trying to find the best way to execute some javascript as part of my view function. In the view function I want to create a canvas object and then execute a native function that inserts some data into it based on my model. The parts individually…
abingham
  • 1,294
  • 1
  • 10
  • 17
1
vote
2 answers

Removing commas from inside quoted parts of a string in Elm 0.16

Right now I am trying to remove any commas that are contained within quotation marks and replace them with spaces in this string: (,(,data,"quoted,data",123,4.5,),(,data,(,!@#,(,4.5,),"(,more","data,)",),),) I am currently using this function that…
Thomas Lloyd
  • 67
  • 1
  • 6
1
vote
1 answer

Elm read HTTP response body for non-200 response

How to read HTTP response body for a non 200 HTTP status getJson : String -> String -> Effects Action getJson url credentials = Http.send Http.defaultSettings { verb = "GET" , headers = [("Authorization", "Basic " ++ credentials)] ,…
alpha_cod
  • 1,933
  • 5
  • 25
  • 43
1
vote
1 answer

Capitalize Every Other Letter in a String -- take / drop versus head / tail for Lists

I have spent the past afternoon or two poking at my computer as if I had never seen one before. Today's topic Lists The exercise is to take a string and capitalize every other letter. I did not get very far... Let's take a list x = String.toList…
john mangual
  • 7,718
  • 13
  • 56
  • 95
1
vote
1 answer

Elm send message to mailbox in update function

I've the following Action handler in my update function of Elm StartApp MUV framework. signupAlertMailbox : Signal.Mailbox String signupAlertMailbox = Signal.mailbox "" update : Action -> Model -> (Model, Effects Action) update action model = …
alpha_cod
  • 1,933
  • 5
  • 25
  • 43
1
vote
1 answer

elm debugger says "no watches" when I do have one

I have this simple code: module Main where import Debug import Html exposing (Html,text,select) import Html.Attributes exposing (id) import StartApp.Simple as StartApp main : Signal Html main= StartApp.start…
niceman
  • 2,653
  • 29
  • 57
1
vote
2 answers

how to implement map7 in Elm

I need to use do this input = Signal.sampleOn delta <| Signal.map7 Key Keyboard.arrows (checknumcode '1') (checknumcode '2') (checknumcode '3') (checknumcode '4') (checknumcode '5') delta but Signal do not have…
SwordW
  • 592
  • 2
  • 6
  • 20
1
vote
1 answer

Access virtual DOM contents

I wanted to implement a walkthrough tutorial but to do that I realised I needed to be able to select HTML elements from a property value (eg. name or id), ie get the value of a property from an HTML node. I think there currentlyis no way of getting…
Deimos
  • 1,835
  • 1
  • 16
  • 15
1
vote
1 answer

Is it possible not to recreate whole model every timer Tick in Elm?

For example, I need a timer on the page. So I can have an action every 100 ms type Action = Tick Time and I have field time in my Model. Model could be big, but I need to recreate it and whole view every 100 ms because of time field. I think it…
ais
  • 2,514
  • 2
  • 17
  • 24
1
vote
2 answers

Use ports for rendering in elm

I would like to use the flot.js 2D plot library from elm. I first thought I'd write a native wrapper for it but it seems to be discouraged. I therefore want to try to use ports to send the values to plot to JavaScript (ie the call to flot.js would…
Deimos
  • 1,835
  • 1
  • 16
  • 15
1
vote
1 answer

Elm updating model from json response

I am having an issue with updating a model from a JSON response through one of my actions. Here is the setup: I have models that looks like this: type alias Model = { totals: Totals.Total // all values are initialized as 0 or 0.0 } -- In other…
sambev
  • 131
  • 7
1
vote
1 answer

Image does not resize when resizing the browser window (elm)

I'm trying to listen to the "resize" event and change the image size accordingly. However the image size does not change. I think the reason is that my "onResize" function is at the wrong place. But I don't know where else to embed it in this…
Charles Gao
  • 679
  • 2
  • 7
  • 13
1
vote
1 answer

Elm - updating the model based on values in a signal

I am using a port to pass an object from javascript to elm, and I want to update my model based on the value received from JS. Heres my code: type alias Model = { x: String, y: String } type Action = Received { x: String, y: String } …
uuba
  • 13
  • 3
1 2 3
99
100