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
12
votes
4 answers

How can I maintain stylesheets during Elm development?

I'm new to Elm and trying to build a web app with elm-html. I'm having trouble setting up my workflow to develop and see my results quickly. I've used elm-reactor to serve and reload my changes but that serves my app from localhost:8000/Foo.elm…
Eric
  • 1,511
  • 1
  • 15
  • 28
12
votes
1 answer

Infinite scroll in Elm

I am building a simple application in Elm that show just a list of divs one under the other, and I would like to add infinite scroll functionality, to add new content every time the last div of the page appears in the viewport. Is there a way in Elm…
marcosh
  • 8,780
  • 5
  • 44
  • 74
12
votes
1 answer

How to extract the results of Http Requests in Elm

Using Elm's html package it is possible to make http requests: https://api.github.com/users/nytimes/repos These are all the New York Times repos on Github. Basically there are two items I'd want from the Github response, the id and name [ { "id":…
john mangual
  • 7,718
  • 13
  • 56
  • 95
12
votes
5 answers

How to implement a slider in elm

I want to link a slider and a input text area such that when I change one the other is automatically updated. I found elm-reactor's implementation, which uses native JavaScript and works with a callback. The callback is called whenever the slider is…
Deimos
  • 1,835
  • 1
  • 16
  • 15
12
votes
1 answer

How to print index of selected option in Elm?

I have a . E.g. if I select the first option, it should print 0, if I select the second option, it should…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
12
votes
1 answer

Does Elm has an equivalent of Haskell's As-Pattern

In Haskell, you can write f x@(a, b, c) = x Does Elm have an equivalent of this?
Not an ID
  • 2,579
  • 2
  • 21
  • 28
11
votes
1 answer

What *is* a Browser.Navigation.Key in Elm?

I'm starting to work with Elm's Browser.application which is a lot of fun, but one thing that (as far as I can tell) is never really explained is the Browser.Navigation.Key type. The elm docs say A navigation Key is needed to create navigation…
Eleanor Holley
  • 691
  • 1
  • 7
  • 27
11
votes
5 answers

Elm VSCode plugin does not format on save

I have copied the following question from the Elm Slack channel for posterity. I am having trouble getting the Elm VSCode plugin to format on save. I have set the absolute path to my global install of elm-format in settings.json. I have also set…
bgins
  • 179
  • 2
  • 7
11
votes
1 answer

Cannot find toString

I'm trying to use the Basics.toString function: type Foo = Bar | Baz main = text (toString Bar) which, according to the Basics documentation, should be imported by default, but I'm getting a compile error: I cannot find a `toString` variable: 13|…
Simon Morgan
  • 2,018
  • 5
  • 23
  • 36
11
votes
1 answer

How can I read a local file in Elm?

I'm exploring the idea of replacing an XML->XSLT->HTML workflow with Elm, just to see if I can do it. I found an Elm XML parser, and now I just need to figure out how to read a local file into Elm. I can't seem to find anything anywhere that…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
11
votes
1 answer

Elm lang redirect to external URL

How can I redirect to external url? I've tried with Navigation module, but it seems to work only for local routes. Is there a way to do it natively, without js ports? I.e. window.location.href = http://google.com; Edit: I somehow missed…
Ilya
  • 1,120
  • 1
  • 12
  • 33
11
votes
2 answers

why the Elm Architecture is called TEA?

I've seen this TEA acronym (?!) in many places all over the web - means elm architecture - but i don't understand what each initial stands for. Thanks.
AIon
  • 12,521
  • 10
  • 47
  • 73
11
votes
2 answers

Module `Html` does not expose `beginnerProgram`

I'm trying to import Html exposing (beginnerProgram), as it is shown there and there, but the compiler doesn't agree : "Module Html does not expose beginnerProgram". Thanks in advance.
Algorythmis
  • 642
  • 1
  • 7
  • 19
11
votes
1 answer

I cannot find module 'Html.App' elm v0.18

When upgrading from elm v0.17.1 to v0.18 we see the following error: I cannot find module 'Html.App'. the App method was available in v1.1.0 of the Html package see: http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-App but appears to…
nelsonic
  • 31,111
  • 21
  • 89
  • 120
11
votes
1 answer

Did Signal get renamed or removed from Elm v0.17?

I am following the tutorial of http://www.elm-tutorial.org/020_signals/introduction.html elm. When I tried to execute the Signals example. I got the following error. Exception : Cannot find variable `Signal.map`. 12| Signal.map view Mouse.x …
Ranjith Raj D
  • 184
  • 2
  • 12