1,895
questions
104
votes
5
answers
8k
views
Difference in Elm between type and type alias?
In Elm, I can't figure out when type is the appropriate keyword vs. type alias. The documentation doesn't seem to have an explanation of this, nor can I find one in the release notes. Is this ...
100
votes
1
answer
3k
views
Elm Compiler running forever, computer just getting hot
I'm not sure what's causing this issue, but in a project, I'm building, the compiler is taking hours just to compile a module. The total size of my codebase is 352KB, but none of the modules are over ...
64
votes
6
answers
14k
views
What does the `<<` operator mean in elm?
In the following code taken from Elm Form Example, line 122, what does the << operator mean?
Field.field Field.defaultStyle (Signal.send updateChan << toUpdate) "" content
Couldn't find ...
56
votes
2
answers
5k
views
What does "! []" Elm code syntax in Todomvc mean
Coming from react, I am learning to understand Elm.
In the Todomvc example code, there is the following code snippet:
-- How we update our Model on a given Msg?
update : Msg -> Model -> ( ...
52
votes
3
answers
25k
views
What are the advantages and disadvantages of Angular.js vs. Elm?
I'm looking into doing some reactive programming in the browser and comparing angular.js (http://angularjs.org/) with Elm (http://elm-lang.org/).
What are the relative benefits / problems with each?
48
votes
6
answers
10k
views
How to set focus on an element in Elm?
How can I set the focus on a Html element in Elm? I tried to set the autofocus attribute on the element and it only sets the focus on the page load.
46
votes
1
answer
7k
views
How to create HTML data attributes in Elm?
I need to tag my Elm.Http elements with custom "data-*" attributes, for example:
<tr data-row="1">...</tr>
I have tried the following:
import Html exposing (..)
import Html.Attributes ...
44
votes
3
answers
11k
views
Elm: How would you build and style your UI?
For the last few days I've learning about Elm, and it has been a refreshing experience. So much that I do not want to go back into JS land, :-(.
My problem is that I still do not see a way to produce ...
42
votes
3
answers
10k
views
How does Elm compare to ClojureScript?
I'm reaching a point where GUI coding with Backbone.js object-oriented MVC pattern is getting quite complex, and looking around at other paradigms. MDV, FRP, ECS, oh my.
How does Elm compare to ...
34
votes
1
answer
10k
views
ReasonML vs Elm [closed]
I saw this ReasonML vs TypeScript question here at StackOverflow, now I'm wondering how ReasonML and Elm compare to each other.
What are their similarities and differences? Which one should I use ...
33
votes
2
answers
7k
views
Run two commands at the same time in Elm
In Elm, and specifically with the Elm Architecture when the app first starts the init function can return a Cmd Msg that is executed. We can use this for sending http requests or send a message to ...
33
votes
3
answers
22k
views
How do I get a list item by index in elm?
I got a list, and now I want the nth item. In Haskell I would use !!, but I can't find an elm variant of that.
32
votes
4
answers
9k
views
How to achieve behavior of setTimeout in Elm
I'm writing a web game in Elm with lot of time-dependent events and I'm looking for a way to schedule an event at a specific time delay.
In JavaScript I used setTimeout(f, timeout), which obviously ...
32
votes
6
answers
13k
views
How to handle Enter key press in input field?
I built a simple app for learning purposes and want to be able to dispatch an action when the user presses Enter key in input field
view : Model -> Html Action
view model =
let
items ...
31
votes
1
answer
3k
views
Cancel subscriptions in Elm
I am following the Elm guide and I am at the point where I try to implement a Pause button for the clock example. In the guide it is written:
Add a button to pause the clock, turning the Time ...