jmpavlick/json-in-elm/2.0.0

Json.InElm.Keypath

type alias FieldAccessor =
FieldAccessor

Representation of a value used to access a field in a JSON document.

at : String -> Keypath -> Keypath

Updates a KeyPath and adds the name of a field in a JSON document.

index : Int -> Keypath -> Keypath

Updates a KeyPath and adds the value of an index in a JSON array.

init : Keypath

To construct a Keypath, you must start with an empty value.

toString : Keypath -> String

Renders a Keypath to a string.

(a -> b -> b)
-> { fromIndex : Int -> a
, fromAt : String -> a
}
-> b
-> Keypath
-> b

Fold over the values in a KeyPath to transform them into a value of some other type.

(Hint: toString implements fold directly! You can check out the source on Github to see how it's done.)