From 0.19 Elm introduced 4 ways to boot an app:
- sandbox (no outside interaction)
- element (simple outside interaction - side effect, flags, subscriptions)
- document (same as above but with title tag control)
- application (whole SPA features)
From 0.19 Elm introduced 4 ways to boot an app:
| module ID exposing (ID(..), decodeFromString, decoder, encode, encodeAsString, fromInt, toInt, toString) | |
| import Json.Decode as Decode exposing (Decoder) | |
| import Json.Encode as Encode exposing (Value) | |
| {-| This type ensures you get a type error if you for example accidentally pass a UserId in place of a CompanyId | |
| -} | |
| type ID phantom | |
| = ID Int |
Option<T> |
non-Option (T | undefined) |
|
|---|---|---|
| accessing property | userOption.map(user => user.age) |
userNullish?.age |
| calling a method | userOption.map(user => user.fn()) |
userNullish?.fn() |
| providing fallback | ageOption.getOrElse(0) |
ageNullish ?? 0 |
| filter | ageOption.filter(checkIsOddNumber) |
`ageNull |