[{"name":"Form","comment":" Provides a way to package the fields, accessors, and business logic pertaining to a form behind a consistent interface.\n\n\n# Form\n\n@docs Form\n\n\n# Construct\n\n@docs new\n\n\n# Accessors\n\n@docs Accessor, get, set, modify, update\n\n\n# Query\n\n@docs isValid, isInvalid\n\n\n# Validate\n\n@docs validate, validateAsMaybe, validateAsResult\n\n\n# Convert\n\n@docs toState\n\n","unions":[{"name":"Form","comment":"\n\n  - `state`: Typically a record containing fields and possibly other forms.\n  - `accessors`: Typically a record containing getters/setters and anything else that needs access to the state of the form.\n  - `error`: The errors produced by an invalid form.\n  - `output`: The data produced by a valid form.\n\n","args":["state","accessors","error","output"],"cases":[]}],"aliases":[{"name":"Accessor","comment":" Combines a way to `get` a value from a property on `state` and a way to `modify` that property's value.\n\n    type alias State =\n        { count : Int\n        , name : String\n        }\n\n    countAccessor : Accessor State Int\n    countAccessor =\n        { get = .count\n        , modify = \\f state -> { state | count = f state.count }\n        }\n\n    nameAccessor : Accessor State String\n    nameAccessor =\n        { get = .name\n        , modify = \\f state -> { state | name = f state.name }\n        }\n\n","args":["state","a"],"type":"{ get : state -> a, modify : (a -> a) -> state -> state }"}],"values":[{"name":"get","comment":" Get the value of a property on the given form.\n","type":"(accessors -> Form.Accessor state a) -> Form.Form state accessors error output -> a"},{"name":"isInvalid","comment":" `True` if the form has errors. `isInvalid form` is equivalent to `not (isValid form)`.\n","type":"Form.Form state accessors error output -> Basics.Bool"},{"name":"isValid","comment":" `True` if the form does not have any errors.\n","type":"Form.Form state accessors error output -> Basics.Bool"},{"name":"modify","comment":" Modify the value of a property on the given form.\n","type":"(accessors -> Form.Accessor state a) -> (a -> a) -> Form.Form state accessors error output -> Form.Form state accessors error output"},{"name":"new","comment":" ","type":"{ init : state, accessors : accessors, validate : state -> Validation.Validation error output } -> Form.Form state accessors error output"},{"name":"set","comment":" Set the value of a property on the given form.\n","type":"(accessors -> Form.Accessor state a) -> a -> Form.Form state accessors error output -> Form.Form state accessors error output"},{"name":"toState","comment":" ","type":"Form.Form state accessors error output -> state"},{"name":"update","comment":" Update the value of a property on the given form.\n","type":"(accessors -> state -> state) -> Form.Form state accessors error output -> Form.Form state accessors error output"},{"name":"validate","comment":" ","type":"Form.Form state accessors error output -> Validation.Validation error output"},{"name":"validateAsMaybe","comment":" ","type":"Form.Form state accessors error output -> Maybe.Maybe output"},{"name":"validateAsResult","comment":" ","type":"Form.Form state accessors error output -> Result.Result (List.List error) output"}],"binops":[]},{"name":"Form.List","comment":" Provides a way to manage an ordered list of uniquely identifiable forms.\n\n\n# Forms\n\n@docs Forms, Id\n\n\n# Construct\n\n@docs empty, fromList\n\n\n# Accessors\n\n@docs get, set, modify, update\n\n\n# Change\n\n@docs prepend, append, remove\n\n\n# Validate\n\n@docs validate, validateAsMaybe, validateAsResult\n\n\n# Convert\n\n@docs toList\n\n","unions":[{"name":"Forms","comment":" An ordered list of uniquely identifiable forms. The identifiers are automatically assigned and managed.\n","args":["form"],"cases":[]}],"aliases":[{"name":"Id","comment":" An identifier is represented by a non-negative integer.\n","args":[],"type":"Basics.Int"}],"values":[{"name":"append","comment":" Add a form to the end of the list.\n","type":"form -> Form.List.Forms form -> Form.List.Forms form"},{"name":"empty","comment":" Create an empty list of forms.\n","type":"Form.List.Forms form"},{"name":"fromList","comment":" Create an ordered list of uniquely identifiable forms derived from the given list of forms.\n","type":"List.List form -> Form.List.Forms form"},{"name":"get","comment":" Get the value of a property associated with the form identified by the given identifier.\n\nIf the form with the given identifier cannot be found then `Nothing` is returned.\n\n","type":"Form.List.Id -> (accessors -> Form.Accessor state a) -> Form.List.Forms (Form.Form state accessors error output) -> Maybe.Maybe a"},{"name":"modify","comment":" Modify the value of a property associated with the form identified by the given identifier.\n\nIf the form with the given identifier cannot be found then no change is made.\n\n","type":"Form.List.Id -> (accessors -> Form.Accessor state a) -> (a -> a) -> Form.List.Forms (Form.Form state accessors error output) -> Form.List.Forms (Form.Form state accessors error output)"},{"name":"prepend","comment":" Add a form to the start of the list.\n","type":"form -> Form.List.Forms form -> Form.List.Forms form"},{"name":"remove","comment":" Remove the form identified by the given identifier.\n\nIf the form with the given identifier cannot be found then no change is made.\n\n","type":"Form.List.Id -> Form.List.Forms form -> Form.List.Forms form"},{"name":"set","comment":" Set the value of a property associated with the form identified by the given identifier.\n\nIf the form with the given identifier cannot be found then no change is made.\n\n","type":"Form.List.Id -> (accessors -> Form.Accessor state a) -> a -> Form.List.Forms (Form.Form state accessors error output) -> Form.List.Forms (Form.Form state accessors error output)"},{"name":"toList","comment":" ","type":"Form.List.Forms form -> List.List ( Form.List.Id, form )"},{"name":"update","comment":" Update the value of a property associated with the form identified by the given identifier.\n\nIf the form with the given identifier cannot be found then no change is made.\n\n","type":"Form.List.Id -> (accessors -> state -> state) -> Form.List.Forms (Form.Form state accessors error output) -> Form.List.Forms (Form.Form state accessors error output)"},{"name":"validate","comment":" ","type":"(Form.List.Id -> x -> y) -> Form.List.Forms (Form.Form state accessors x output) -> Validation.Validation y (List.List output)"},{"name":"validateAsMaybe","comment":" ","type":"(Form.List.Id -> x -> y) -> Form.List.Forms (Form.Form state accessors x output) -> Maybe.Maybe (List.List output)"},{"name":"validateAsResult","comment":" ","type":"(Form.List.Id -> x -> y) -> Form.List.Forms (Form.Form state accessors x output) -> Result.Result (List.List y) (List.List output)"}],"binops":[]}]