Elm
CLI commands
elm-repl
repl
elm-reactor
to build apps like webpack does
elm-make
to compile apps into HTML and JS
eg.
elm-make Main.elm --output=main.html
elm-package
like npm for elm
notable commands
install
: install the dependencies in elm-package.jsonpublish
: publish your library to the Elm Package Catalogbump
: bump version numbers based on API changesdiff
: get the difference between two APIs
Core language
strings
"hello" -- "hello"
"hello" ++ "world" -- "helloworld"
number
10/3 -- 3.33333 (float)
10//3 -- 3 (Int)
functions
isNegative n = n < 0
isNegative 4 -- False
conditionals
if True then "hello" else "world" -- True
lists
Arrays of the same type
names = [ "Alice", "Bob", "Chuck" ]
List methods
List.isEmtpy
List.length
List.sort
List.map
Tuples
Array of fixed number of values with any type.
(True, "name accepted!")
Work flow
Redux works similar like Elm.
- Model (Redux store)
- Msg (Redux action)
- Update (Redux reducer)