elm-in-elm/compiler/1.0.0

NOTE: the latest version is 1.0.1

Elm.Data.Binding

Binding in the let...in expression.

let
    myNumber =
        123


    answer =
        42
in
myNumber + answer

contains two bindings: myNumber and answer.

type alias Binding expr =
{ name : String
, body : expr
}
combine : Binding (Result x a) -> Result x (Binding a)

Switch the Result and the expression inside the binding. Similar to Result.Extra.combine.

combine { name = "foo", body = Ok (Int 5) }
--> Ok { name = "foo", body = Int 5 }
map : (e1 -> e2) -> Binding e1 -> Binding e2

Apply a function to the expression inside the binding.