Formerly Morgan-Stanley/morphir-elm. Search finds this package by either name.
This module provides convenient but unsafe operations that the tooling will translate into safe operation in the runtime environment. Sample use:
type alias Input =
{ name : Maybe String
, age : String
}
type alias Validated =
{ name : String
, age : Int
}
validate : Input -> Validated
validate input =
{ name = required input.name
, age = parse input.age
}Indicate that the String value should be parsed into a specific type without specifying how.
Important: running this in Elm will always fail!
parse "11" + 2 -- compiles, runtime error in Elm
Indicate that a value is required without handling missing values.