[{"name":"Loadable","comment":" Loadable and reloadable data. `Loadable` is an extension of `RemoteData` to\ninclude a loading state in the success and failure cases.\n\n\n## Types\n\n@docs Loadable, Value\n\n\n## Constructors\n\n@docs notAsked, loading, succeed, fail\n\n\n## Combinators\n\n@docs map, andMap, andThen, combineMap, fromMaybe, fromResult, toLoading, toNotLoading, andMapWith, combineMapWith\n\n\n## Destructors\n\n@docs withDefault, toMaybe, toMaybeError, isLoading, unwrap, value\n\n","unions":[{"name":"Loadable","comment":" A `Loadable` value is either empty, failed, or succeeded, and may be loading\nor not\n","args":["e","a"],"cases":[]},{"name":"Value","comment":" The value of a `Loadable`, aside from its loading state\n","args":["e","a"],"cases":[["Empty",[]],["Failure",["e"]],["Success",["a"]]]}],"aliases":[],"values":[{"name":"andMap","comment":" Apply a function to the value of a `Loadable`\n\n    succeed (\\a -> a + 1) |> andMap (succeed 1) --> succeed 2\n\n","type":"Loadable.Loadable e a -> Loadable.Loadable e (a -> b) -> Loadable.Loadable e b"},{"name":"andMapWith","comment":" Apply a function to the value of a `Loadable`, combining the errors.\n\nNOTE: This is intended to be used in a pipeline, with errors accumulating left\nto right _in the pipeline_ not in the order of arguments to the function. See\nthe examples.\n\n    succeed (\\a -> a ++ \"b\")\n        |> andMapWith (++) (succeed \"a\")\n        --> succeed \"ab\"\n\n    fail \"a\"\n        |> andMapWith (++) (fail \"b\")\n        --> fail \"ab\"\n\n","type":"(e -> e -> e) -> Loadable.Loadable e a -> Loadable.Loadable e (a -> b) -> Loadable.Loadable e b"},{"name":"andThen","comment":" Should match the semantics of the Monad instance for\n\n```haskell\nExceptT e (MaybeT (Writer Any))\n```\n\n    succeed 1 |> andThen (\\a -> succeed (a + 100)) --> succeed 101\n\n    succeed 1 |> andThen (\\_ -> fail \"error\") --> fail \"error\"\n\n    fail \"error\" |> andThen (\\_ -> loading) --> fail \"error\"\n\n    notAsked |> andThen (\\_ -> loading) --> notAsked\n\n    loading |> andThen (\\_ -> notAsked) --> loading\n\n","type":"(a -> Loadable.Loadable e b) -> Loadable.Loadable e a -> Loadable.Loadable e b"},{"name":"combineMap","comment":" Combine a list of `Loadable` values\n\n    combineMap succeed [ 1, 2, 3 ]\n    --> succeed [ 1, 2, 3 ]\n\n    let\n        odd n =\n            modBy 2 n == 1\n        failIfOdd n =\n            if odd n then\n                fail (String.fromInt n)\n            else\n                succeed n\n    in\n    combineMap failIfOdd [ 1, 2, 3 ]\n    --> fail \"1\"\n\n","type":"(a -> Loadable.Loadable e b) -> List.List a -> Loadable.Loadable e (List.List b)"},{"name":"combineMapWith","comment":" Combine a list of `Loadable` values with a function that combines the errors\n\n    combineMapWith (\\x _ -> x) == combineMap\n\n    let\n        odd n =\n            modBy 2 n == 1\n        failIfOdd n =\n            if odd n then\n                fail (String.fromInt n)\n            else\n                succeed n\n    in\n    combineMapWith (++) failIfOdd [ 1, 2, 3 ] --> fail \"13\"\n\n","type":"(e -> e -> e) -> (a -> Loadable.Loadable e b) -> List.List a -> Loadable.Loadable e (List.List b)"},{"name":"fail","comment":" A failed value that is not loading\n","type":"e -> Loadable.Loadable e a"},{"name":"fromMaybe","comment":" Convert a `Maybe` into a `Loadable`\n\n    fromMaybe (Just 1) --> succeed 1\n\n    fromMaybe Nothing --> notAsked\n\n","type":"Maybe.Maybe a -> Loadable.Loadable e a"},{"name":"fromResult","comment":" Convert a `Result` into a `Loadable`\n\n    fromResult (Ok 1) --> succeed 1\n\n    fromResult (Err \"error\") --> fail \"error\"\n\n","type":"Result.Result e a -> Loadable.Loadable e a"},{"name":"isLoading","comment":" Check if the `Loadable` is loading\n\n    isLoading loading --> True\n\n    isLoading notAsked --> False\n\n","type":"Loadable.Loadable e a -> Basics.Bool"},{"name":"loading","comment":" An empty value that is loading\n","type":"Loadable.Loadable e a"},{"name":"map","comment":" Map the value of a `Loadable`\n\n    map (\\a -> a + 1) (succeed 1) --> succeed 2\n\n    map (\\_ -> 0) (fail \"error\") --> fail \"error\"\n\n","type":"(a -> b) -> Loadable.Loadable e a -> Loadable.Loadable e b"},{"name":"notAsked","comment":" An empty value that is not loading\n","type":"Loadable.Loadable e a"},{"name":"succeed","comment":" A successful value that is not loading\n","type":"a -> Loadable.Loadable e a"},{"name":"toLoading","comment":" Set loading to `True`\n\n    toLoading loading --> loading\n\n    toLoading notAsked --> loading\n\n","type":"Loadable.Loadable e a -> Loadable.Loadable e a"},{"name":"toMaybe","comment":" Convert a `Loadable` to a `Maybe`\n\n    toMaybe (succeed 1) --> Just 1\n\n    toMaybe notAsked --> Nothing\n\n","type":"Loadable.Loadable e a -> Maybe.Maybe a"},{"name":"toMaybeError","comment":" Convert a `Loadable` to a `Maybe` of the error type\n\n    toMaybeError (fail \"error\") --> Just \"error\"\n\n    toMaybeError notAsked --> Nothing\n\n","type":"Loadable.Loadable e a -> Maybe.Maybe e"},{"name":"toNotLoading","comment":" Set loading to `False`\n\n    toNotLoading loading --> notAsked\n\n    toNotLoading notAsked --> notAsked\n\n","type":"Loadable.Loadable e a -> Loadable.Loadable e a"},{"name":"unwrap","comment":" Unwrap a `Loadable`\n\n    unwrap (succeed 1) --> { value = Success 1, isLoading = False }\n\n    unwrap notAsked --> { value = Empty, isLoading = False }\n\n","type":"Loadable.Loadable e a -> { value : Loadable.Value e a, isLoading : Basics.Bool }"},{"name":"value","comment":" Get the value of a `Loadable`\n\n    value (succeed 1) --> Success 1\n\n    value notAsked --> Empty\n\n","type":"Loadable.Loadable e a -> Loadable.Value e a"},{"name":"withDefault","comment":" Get the success value out of `Loadable` or a fallback if it's not the success case\n\n    withDefault 0 (succeed 1) --> 1\n\n    withDefault 0 notAsked --> 0\n\n","type":"a -> Loadable.Loadable e a -> a"}],"binops":[]}]