The goal of open and closed tag unions is to allow both exhaustiveness checking and composition of tags. The main motivating pieces of code are:
getSettings = \filename ->
rawData <- Task.await (File.readUtf8 filename)
settings <-
module GameState | |
exposing | |
( Game(..) | |
, GameDefinition | |
, PlayState | |
, loading | |
, updateGameDefinition | |
, updatePlayState | |
, updateScore | |
, toReady |
module Main exposing (..) | |
import Html exposing (pre, text, Html) | |
main : Html a | |
main = | |
-- List.range 0 200 | |
-- List.range 3364 3388 | |
-- List.range 216358 216375 |
The goal of the style guide is foremost to promote consistency and reuse of pattern from other languages in order to improve readability and make Elm easier for beginners. This includes moving Elm away from Haskell’s indentation style and even making some parts look closer to JavaScript. These decisions are intentional.
We would like Elm to look friendly and familiar to users of any language — especially JavaScript — so they can discover Elm’s powerful features without being overwhelmed. This does not intend to weaken or discourage any features of Elm, but instead to make them more accessible.
A secondary goal of the style guide is to encourage short diffs when changes are made. This makes changes more clear, and helps when multiple people are collaborating.
This is proposed as a simplified alternative to https://gist.github.com/mgold/f3527359996fdf295843 - what if instead of renaming Mailbox
, we just didn't have a name for that thing?
Rationale:
Signal
returns two distinct values: the Signal
and a way to send a Message
to it.Mailbox
(and alternatively Dispatcher
) give a type alias to that return value.