View elm-2-functions-diff.elm
-- Elm, what is the difference ?
\x y -> (x y) -- <function> : (a -> b) -> a -> b
\x y -> (x, y) -- <function> : a -> b -> ( a, b )
View gist:392dad0dd1f788471fae6eef16ac55a1
-- trying in elm-repl
import Random
type Msg = Foo Bool
r = (Random.generate Foo Random.bool)
-- { type = "leaf", home = "Random", value = Generate (Generator <function>) }
-- : Platform.Cmd.Cmd Repl.Msg
View trying-elm.elm
foo = 10
((-) foo 1)
((-) 1 foo)
-- derived type
-- cmd1 : a -> number
cmd1 = \op -> ((-) foo 1)
cmd1 (-1) -- 9
View elm-new.sh
function elm-new() {
mkdir -p $1
cd $1
# from https://github.com/github/gitignore/blob/master/Elm.gitignore
echo "# elm-package generated files
elm-stuff
# elm-repl generated files
repl-temp-*" > .gitignore
View validaitions-demo.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- These meta tags come first. -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>React Validation Demo</title>
View elm-type-annotation-for-arguments-and-return-type.elm
module Scratch exposing (..)
import String
-- arguments first then return
-- so the arguments are wrapped in braces for disambiguation
-- http://guide.elm-lang.org/types/reading_types.html
View general-to-specific-elm-type.elm
module Build exposing (..)
import Debug
type alias Foobar number =
{ foo : number, bar : number }
build : number -> number -> { foo : number, bar : number }
View Build.elm
-- Version 1
-- No error or warning here
module Build exposing (..)
build : a -> b -> { foo : b, name : a }
build a b =
{ name = a, foo = b }
View elm integer division operator.md

http://guide.elm-lang.org/core_language.html says

Unlike JavaScript, Elm makes a distinction between integers and floating point numbers. Just like Python 3, there is both floating point division (/) and integer division (//).

> 9 / 2
4.5

> 9 // 2
4
View redux for form submission.txt
- INIT
- INPROGRESS
- SUCCESS
- ERROR
reducer is:
{
status: "SUCCESS" | "ERROR" | "INPROGRESS",
data: { },