Elm
Functional language that compiles to js
No runtime errors in practice. No null. No undefined is not a function.
You must handle all cases, statically typed
Functions
Elm has implicit functions, cant change global variables in its
add : Int -> Int -> Int
add num1 num2 = num1 + num2No loops in elm, currying by default(give one argument returns curried ft)
babyAnimals a b = "i love a" ++ a ++ " and " ++ b
babyKoalas = babyAnimals "koalas"
babyKoalas "puppies" -- "i love koalas and puppies"Chaining so no unneeded variables(like lodash chain)
Types
Would have to deal with if mix every time
type Disposition = Surly | Friendly | Ambivalent | Mix Disposition Disposition
type alias Cat = {
name: String,
weight: Float,
disposition: Disposition
}
seamus = Cat "Seamus" 22.2 SurlyMaybe
Json
Must decode and type JSON, must write decoder
Build for Production
Last updated