[{"name":"NestedTuple","comment":" This library provides utility functions for working with nested tuples of\nthe form:\n\n`( a, ( b, ( c, () ) ) )`.\n\n\n# Primitives\n\n@docs empty, cons, head, tail\n\n**Note:** From the four primitive functions `empty`, `cons`, `head` and `tail`, all the\nothers can be derived.\n\nIn your own project, you might want to represent a nested tuple as something\nother than a tuple, for example:\n\n  - `type alias MyTuple a b = { head : a, tail : b }`\n  - `type MyTuple a b = MyTuple a b`\n\nIf so, you could just vendor this package and redefine these four functions\nfor your preferred data type, then delete all the type annotations, and everything\nelse should _just work_.\n\n\n# Utilities\n\n@docs singleton, mapHead, mapTail\n\n\n# Appenders, mappers and folders\n\n@docs define\n\n\n## Appenders\n\n@docs appender, endAppender\n\n\n## Mappers\n\n@docs mapper, endMapper, mapper2, endMapper2, mapper3, endMapper3\n\n\n## Folders\n\n@docs folder, endFolder, folder2, endFolder2, folder3, endFolder3\n\n\n## Getters\n\n@docs defineGetters, getter, endGetters\n\n\n## Setters\n\n@docs defineSetters, setter, endSetters\n\n","unions":[],"aliases":[],"values":[{"name":"appender","comment":" Build up a nested tuple by appending values to the end of it.\n\nThis needs to be used in conjunction with `define` and `endAppender`:\n\n    import NestedTuple exposing (define, appender, endAppender)\n\n    define\n        |> appender 1\n        |> endAppender\n\n    --> ( 1, () )\n\n    define\n        |> appender \"hello\"\n        |> appender \"world\"\n        |> endAppender\n\n    --> ( \"hello\", ( \"world\", () ) )\n\n","type":"head -> (( head, tail ) -> toAppender) -> tail -> toAppender"},{"name":"cons","comment":" Prepend a value to a nested tuple.\n","type":"head -> tail -> ( head, tail )"},{"name":"define","comment":" Begin the definition of an `appender`, `mapper`, or `folder`.\n","type":"a -> a"},{"name":"defineGetters","comment":" Begin the definition of a tuple of `getters`.\n","type":"{ focus : focus -> focus, appendToGetters : getters -> getters }"},{"name":"defineSetters","comment":" Begin the definition of a tuple of `setters`.\n","type":"{ focus : focus -> focus, appendToSetters : setters -> setters }"},{"name":"empty","comment":" Create an empty nested tuple.\n","type":"()"},{"name":"endAppender","comment":" Complete the definition of an `appender`.\n","type":"(() -> appender) -> appender"},{"name":"endFolder","comment":" Complete the definition of a `folder`.\n","type":"((acc -> empty -> acc) -> folder) -> folder"},{"name":"endFolder2","comment":" Complete the definition of a `folder2`.\n","type":"((acc -> empty -> empty -> acc) -> folder2) -> folder2"},{"name":"endFolder3","comment":" Complete the definition of a `folder3`.\n","type":"((acc -> empty -> empty -> empty -> acc) -> folder3) -> folder3"},{"name":"endGetters","comment":" Complete the definition of a tuple of `getters`.\n","type":"{ focus : focus, appendToGetters : () -> getters } -> getters"},{"name":"endMapper","comment":" Complete the definition of a `mapper`.\n","type":"((() -> ()) -> mapper) -> mapper"},{"name":"endMapper2","comment":" Complete the definition of a `mapper2`.\n","type":"((() -> () -> ()) -> mapper2) -> mapper2"},{"name":"endMapper3","comment":" Complete the definition of a `mapper3`.\n","type":"((() -> () -> () -> ()) -> mapper3) -> mapper3"},{"name":"endSetters","comment":" Complete the definition of a tuple of `setters`.\n","type":"{ focus : focus, appendToSetters : () -> setters } -> setters"},{"name":"folder","comment":" Create a `folder` for a nested tuple by defining fold functions for each element of the tuple.\n\nThis needs to be used in conjunction with `define` and `endFolder`:\n\n    import NestedTuple exposing (define, folder, endFolder)\n\n    sum =\n        define\n            |> folder (\\int acc -> int + acc)\n            |> folder (\\str acc -> String.length str + acc)\n            |> endFolder\n\n    sum 0 ( 1, ( \"foo\", () ) )\n\n    --> 4\n\n","type":"(head -> accForHead -> accForTail) -> ((accForHead -> ( head, tail ) -> accForNext) -> toFolder) -> (accForTail -> tail -> accForNext) -> toFolder"},{"name":"folder2","comment":" Create a `folder2` for two nested tuples by defining fold functions for each element of the tuples.\n\nThis needs to be used in conjunction with `define` and `endFolder2`:\n\n    import NestedTuple exposing (define, folder2, endFolder2)\n\n    sum =\n        define\n            |> folder2 (\\int1 int2 acc -> int1 + int2 + acc)\n            |> folder2 (\\str1 str2 acc -> String.length (str1 ++ str2) + acc)\n            |> endFolder2\n\n    sum 0\n        ( 1, ( \"foo\", () ) )\n        ( 2, ( \"bar\", () ) )\n\n    --> 9\n\n","type":"(headA -> headB -> accForHead -> accForTail) -> ((accForHead -> ( headA, tailA ) -> ( headB, tailB ) -> accForNext) -> toFolder2) -> (accForTail -> tailA -> tailB -> accForNext) -> toFolder2"},{"name":"folder3","comment":" Create a `folder3` for three nested tuples by defining fold functions for each element of the tuples.\n\nThis needs to be used in conjunction with `define` and `endFolder3`:\n\n    import NestedTuple exposing (define, folder3, endFolder3)\n\n    sum =\n        define\n            |> folder3 (\\int1 int2 int3 acc -> int1 + int2 + int3 + acc)\n            |> folder3 (\\str1 str2 str3 acc -> String.length (str1 ++ str2 ++ str3) + acc)\n            |> endFolder3\n\n    sum 0\n        ( 1, ( \"foo\", () ) )\n        ( 2, ( \"bar\", () ) )\n        ( 3, ( \"baz\", () ) )\n\n    --> 15\n\n","type":"(headA -> headB -> headC -> accForHead -> accForTail) -> ((accForHead -> ( headA, tailA ) -> ( headB, tailB ) -> ( headC, tailC ) -> accForNext) -> toFolder3) -> (accForTail -> tailA -> tailB -> tailC -> accForNext) -> toFolder3"},{"name":"getter","comment":" Create a tuple of `getters` for a nested tuple.\n\nThis needs to be used in conjunction with `defineGetters` and `endGetters`:\n\n    import NestedTuple exposing (defineGetters, getter, endGetters)\n\n    defineGetters\n        |> getter\n        |> getter\n        |> endGetters\n\n    --: ( ( a, ( b, () ) ) -> a\n        , ( ( a, ( b, () ) ) -> b\n          , () \n          ) \n        )\n\n","type":"{ appendToGetters : ( tuple -> head, nextGetters ) -> toGetters, focus : tuple -> ( head, tail ) } -> { appendToGetters : nextGetters -> toGetters, focus : tuple -> tail }"},{"name":"head","comment":" Get the head (first element) of a nested tuple.\n","type":"( head, tail ) -> head"},{"name":"mapHead","comment":" Map over the head of a nested tuple.\n","type":"(headA -> headB) -> ( headA, tail ) -> ( headB, tail )"},{"name":"mapTail","comment":" Map over the tail of a nested tuple.\n","type":"(tailA -> tailB) -> ( head, tailA ) -> ( head, tailB )"},{"name":"mapper","comment":" Create a `mapper` for a nested tuple by defining a map functions for each element of the tuple.\n\nThis needs to be used in conjunction with `define` and `endMapper`:\n\n    import NestedTuple exposing (define, mapper, endMapper)\n\n    double =\n        define\n            |> mapper (\\int -> int * 2)\n            |> mapper (\\float -> float + float)\n            |> endMapper\n\n    double ( 1, ( 1.5, () ) )\n\n    --> ( 2, ( 3.0, () ) )\n\n","type":"(headA -> headB) -> ((( headA, tailA ) -> ( headB, tailB )) -> toMapper) -> (tailA -> tailB) -> toMapper"},{"name":"mapper2","comment":" Create a `mapper` for two nested tuples by defining map functions for each element of the tuples.\n\nThis needs to be used in conjunction with `define` and `endMapper2`:\n\n    import NestedTuple exposing (define, mapper2, endMapper2)\n\n    add =\n        define\n            |> mapper2 (\\int1 int2 -> int1 + int2)\n            |> mapper2 (\\float1 float2 -> float1 + float2)\n            |> endMapper2\n\n    add ( 1, ( 1.5, () ) )\n        ( 2, ( 2.5, () ) )\n\n    --> ( 3, ( 4.0, () ) )\n\n","type":"(headA -> headB -> headC) -> ((( headA, tailA ) -> ( headB, tailB ) -> ( headC, tailC )) -> toMapper2) -> (tailA -> tailB -> tailC) -> toMapper2"},{"name":"mapper3","comment":" Create a `mapper` for three nested tuples by defining map functions for each element of the tuples.\n\nThis needs to be used in conjunction with `define` and `endMapper3`:\n\n    import NestedTuple exposing (define, mapper3, endMapper3)\n\n    add =\n        define\n            |> mapper3 (\\int1 int2 int3 -> int1 + int2 + int3)\n            |> mapper3 (\\float1 float2 float3 -> float1 + float2 + float3)\n            |> endMapper3\n\n    add ( 1, ( 1.5, () ) )\n        ( 2, ( 2.5, () ) )\n        ( 3, ( 3.5, () ) )\n\n    --> ( 6, ( 7.5, () ) )\n\n","type":"(headA -> headB -> headC -> headD) -> ((( headA, tailA ) -> ( headB, tailB ) -> ( headC, tailC ) -> ( headD, tailD )) -> toMapper3) -> (tailA -> tailB -> tailC -> tailD) -> toMapper3"},{"name":"setter","comment":" Create a tuple of `setters` for a nested tuple.\n\nThis needs to be used in conjunction with `defineSetters` and `endSetters`:\n\n    import NestedTuple exposing (defineSetters, setter, endSetters)\n\n    defineSetters\n        |> setter\n        |> setter\n        |> endSetters\n\n    --: ( a -> ( a, ( b, () ) ) -> ( a, ( b, () ) )\n        , ( b -> ( a, ( b, () ) ) -> ( a, ( b, () ) )\n          , () \n          ) \n        )\n\n","type":"{ appendToSetters : ( head -> tuple -> tuple, nextSetters ) -> toSetters, focus : (( head, tail ) -> ( head, tail )) -> tuple -> tuple } -> { appendToSetters : nextSetters -> toSetters, focus : (tail -> tail) -> tuple -> tuple }"},{"name":"singleton","comment":" Create a nested tuple with one element.\n","type":"head -> ( head, () )"},{"name":"tail","comment":" Get the tail (everything except the first element) of a nested tuple.\n","type":"( head, tail ) -> tail"}],"binops":[]}]