[
    {
        "name": "Lazy.Tree.Zipper",
        "comment": " Zipper implementation for `Lazy.Tree`.\n\n> A zipper is a technique of representing an aggregate data structure so that it is convenient\n> for writing programs that traverse the structure arbitrarily and update its contents,\n> especially in purely functional programming languages.\n\n`Zipper` is a secret sauce that gives `Tree` real power.\nIt provides an easy way to query and modify the `Tree` in a clever and very flexible way.\n\nTypes within this module are exposed type aliases to make it easy extend default functionality of `Zipper`.\n\n\n# Types\n\n@docs Breadcrumb, Zipper, fromTree\n\n\n# Query\n\n@docs current, children, isRoot, isEmpty, attempt\n\n\n# Operations\n\n@docs insert, delete, update, updateItem, setTree, open, openPath, openAll, attemptOpenPath, up, upwards, root\n\n\n# Transformations\n\n@docs map, filter\n\n\n# Breadcrumbs\n\n@docs breadCrumbs\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "Breadcrumb",
                "comment": " ** Be careful when comparing `Breadcrumb`s using `(==)`.**\nDue to use of lazyness `(==)` isn't reliable for comparing Breadcrumbs.\n",
                "args": [
                    "a"
                ],
                "type": "( Forest a, a, Forest a )"
            },
            {
                "name": "Zipper",
                "comment": " ",
                "args": [
                    "a"
                ],
                "type": "( Tree a, List (Breadcrumb a) )"
            }
        ],
        "values": [
            {
                "name": "attempt",
                "comment": " Attempt to perform action over zipper and return original `Zipper` in cases where this action returns `Nothing`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> attempt delete\n        |> current\n    --> \"foo\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> attempt (open ((==) \"foo\"))\n        |> attempt delete\n        |> current\n    --> \"foo\"\n\n",
                "type": "(Zipper a -> Maybe (Zipper a)) -> Zipper a -> Zipper a"
            },
            {
                "name": "attemptOpenPath",
                "comment": " Similar to [`openPath`](#openPath) but ingnore failed steps.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> attemptOpenPath (==) [ \"not-here\", \"bar\" ]\n        |> current\n    --> \"bar\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> attemptOpenPath (==) [ \"baz\" ]\n        |> current\n    --> \"foo\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\"))\n        |> attemptOpenPath (==) [ \"not-here\", \"bar\", \"missng\", \"baz\" ]\n        |> current\n    --> \"baz\"\n\n",
                "type": "(b -> a -> Bool) -> List b -> Zipper a -> Zipper a"
            },
            {
                "name": "breadCrumbs",
                "comment": " Get `Breacrub`s as indexed `List`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\"))\n        |> attemptOpenPath (==) [ \"bar\", \"baz\" ]\n        |> breadCrumbs\n    --> [ ( 1, \"bar\" ), ( 2, \"foo\" )]\n\n",
                "type": "Zipper a -> List ( Int, a )"
            },
            {
                "name": "children",
                "comment": " Get children of current `Tree`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> children\n    --> [ \"bar\" ]\n\n",
                "type": "Zipper a -> List a"
            },
            {
                "name": "current",
                "comment": " Get current `Tree`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> current\n    --> \"foo\"\n\n",
                "type": "Zipper a -> a"
            },
            {
                "name": "delete",
                "comment": " Delete current `Tree` from `Zipper`.\n\nReturns Nothing if root node is removed.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> delete\n    --> Nothing\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> open (always True)\n        |> Maybe.andThen delete\n        |> Maybe.map current\n    --> Just \"foo\"\n\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "filter",
                "comment": " Performs filter on current `Tree` in `Zipper`. See `Tree.filter` for more informations.\n\n    import Lazy.LList as LL\n\n    T.tree 1 (LL.fromList [ T.singleton 2, T.singleton 3, T.singleton 4 ])\n        |> fromTree\n        |> filter ((>) 4)\n        |> children\n    --> [ 2, 3 ]\n\n    T.tree 1 (LL.fromList [ T.singleton 2, T.singleton 3, T.singleton 4 ])\n        |> fromTree\n        |> attempt (open ((==) 1))\n        |> filter ((<) 2)\n        |> root\n        |> children\n    --> [ 3, 4 ]\n\n    T.tree 1 (LL.fromList [ T.insert (T.singleton 5) <| T.singleton 2, T.insert (T.singleton 6) <| T.singleton 3, T.singleton 4 ])\n        |> fromTree\n        |> attempt (open ((==) 1))\n        |> filter ((<) 2)\n        |> Tuple.first\n        |> T.descendants\n        |> LL.andThen (LL.map T.item << T.descendants)\n        |> LL.toList\n    --> [ 6 ]\n\n",
                "type": "(a -> Bool) -> Zipper a -> Zipper a"
            },
            {
                "name": "fromTree",
                "comment": " Init `Zipper` for `Tree`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> current\n    --> \"foo\"\n\n",
                "type": "Tree a -> Zipper a"
            },
            {
                "name": "insert",
                "comment": " Insert sub `Tree` into current `Tree` in `Zipper`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> insert (T.singleton \"baz\")\n        |> children\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "Tree a -> Zipper a -> Zipper a"
            },
            {
                "name": "isEmpty",
                "comment": " Check if current `Tree` in `Zipper` is empty.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> isEmpty\n    --> True\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> isEmpty\n    --> False\n\n",
                "type": "Zipper a -> Bool"
            },
            {
                "name": "isRoot",
                "comment": " Check if `Zipper` is focused on root `Tree`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n       |> fromTree\n       |> isRoot\n    --> True\n\n",
                "type": "Zipper a -> Bool"
            },
            {
                "name": "map",
                "comment": " Map function over `Zipper`.\n\n    import Lazy.Tree as T\n\n    T.singleton 1\n        |> fromTree\n        |> map ((+) 1)\n        |> current\n    --> 2\n\n",
                "type": "(a -> b) -> Zipper a -> Zipper b"
            },
            {
                "name": "open",
                "comment": " Open first children that satisfy given condition.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> open ((==) \"bar\")\n        |> Maybe.map current\n    --> Just \"bar\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\") )\n        |> attempt (open ((==) \"bar\"))\n        |> attempt (open ((==) \"baz\"))\n        |> current\n    --> \"baz\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> open (always True)\n    --> Nothing\n\n",
                "type": "(a -> Bool) -> Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "openAll",
                "comment": " Get `List` of `Zipper`s for all children of current `Zipper`\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> insert (T.singleton \"baz\")\n        |> openAll\n        |> List.map current\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "Zipper a -> List (Zipper a)"
            },
            {
                "name": "openPath",
                "comment": " Open multiple levels reducing list by given function.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\") )\n        |> openPath (==) [ \"bar\", \"baz\" ]\n        |> Result.map current\n    --> Ok \"baz\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> openPath (==) [ \"not-here\", \"baz\" ]\n        |> Result.map current\n    --> Err \"Can't resolve open for \\\"not-here\\\"\"\n\n",
                "type": "(b -> a -> Bool) -> List b -> Zipper a -> Result String (Zipper a)"
            },
            {
                "name": "root",
                "comment": " Back to root `Tree`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\") )\n        |> open ((==) \"bar\")\n        |> Maybe.andThen (open ((==) \"baz\"))\n        |> Maybe.map root\n        |> Maybe.map current\n    --> Just \"foo\"\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> root\n        |> current\n    --> \"foo\"\n\n",
                "type": "Zipper a -> Zipper a"
            },
            {
                "name": "setTree",
                "comment": " Replace current `Tree` with new one.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> setTree (T.singleton \"bar\")\n        |> current\n    --> \"bar\"\n\n",
                "type": "Tree a -> Zipper a -> Zipper a"
            },
            {
                "name": "up",
                "comment": " Return back to parent of current `Tree` in given `Zipper`.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\")\n        |> open ((==) \"bar\")\n        |> Maybe.andThen up\n        |> Maybe.map current\n    --> Just \"foo\"\n\n    T.singleton \"baz\"\n        |> fromTree\n        |> up\n    --> Nothing\n\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "update",
                "comment": " Update current `Tree` using given function.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> update (T.map (\\a -> a ++ \" fighter\"))\n        |> current\n    --> \"foo fighter\"\n\n",
                "type": "(Tree a -> Tree a) -> Zipper a -> Zipper a"
            },
            {
                "name": "updateItem",
                "comment": " Update current `Tree` using given function.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> updateItem (\\i -> i ++ \" fighter\")\n        |> current\n    --> \"foo fighter\"\n\n",
                "type": "(a -> a) -> Zipper a -> Zipper a"
            },
            {
                "name": "upwards",
                "comment": " Perform [`up`](#up) n times.\n\n    import Lazy.Tree as T\n\n    T.singleton \"foo\"\n        |> fromTree\n        |> insert (T.singleton \"bar\" |> T.insert (T.singleton \"baz\") )\n        |> open ((==) \"bar\")\n        |> Maybe.andThen (open ((==) \"baz\"))\n        |> Maybe.andThen (upwards 2)\n        |> Maybe.map current\n    --> Just \"foo\"\n\nReturns given `Zipper` return if `0` is passed:\n\n    T.singleton \"foo\"\n       |> fromTree\n       |> upwards 0\n       |> Maybe.map current\n    --> Just \"foo\"\n\nReturn `Nothing` if there are not enough ancestors in `Zipper`:\n\n    T.singleton 4\n        |> fromTree\n        |> upwards 1\n    --> Nothing\n\nReturn `Nothing` if negative integer is passed:\n\n    T.singleton 4\n        |> fromTree\n        |> upwards -1\n    --> Nothing\n\n",
                "type": "Int -> Zipper a -> Maybe (Zipper a)"
            }
        ],
        "binops": []
    },
    {
        "name": "Lazy.Tree",
        "comment": " This module implements Rose Tree data structure.\n\n> In computing, a multi-way tree or rose tree is a tree data structure\n> with a variable and unbounded number of branches per node.\n\nThis particular implementation uses lazy list construction (using `LList` module)\nto lazily evaluate levels of Tree.\n\n\n# Types & Constructor\n\n@docs Tree, Forest, singleton, build, tree, fromList\n\n\n# Query\n\n@docs isEmpty, item, children, descendants\n\n\n# Modify\n\n@docs insert\n\n\n# Transforms\n\n@docs map, map2, filter, filterMap, sort, sortBy, sortWith, andMap, flatten, andThen\n\n\n# Forest\n\n@docs forestMap, forestMap2\n\n",
        "unions": [
            {
                "name": "Tree",
                "comment": " ** Be careful when comparing `Tree`s using `(==)`.**\nDue to use of lazyness `(==)` isn't reliable for comparing Trees.\n",
                "args": [
                    "a"
                ],
                "cases": []
            }
        ],
        "aliases": [
            {
                "name": "Forest",
                "comment": " ** Be careful when comparing `Forest`s using `(==)`.**\nDue to use of lazyness `(==)` isn't reliable for comparing Forests.\n",
                "args": [
                    "a"
                ],
                "type": "LList (Tree a)"
            }
        ],
        "values": [
            {
                "name": "andMap",
                "comment": " Chain map operations.\n\n    import Lazy.LList as LL\n\n    tree (,) (LL.fromList [ singleton (,), singleton (,), singleton (,) ])\n        |> andMap (tree 1 <| LL.fromList [ singleton 2, singleton 3, singleton 4 ])\n        |> andMap (tree 5 <| LL.fromList [ singleton 6, singleton 7 ])\n        |> children\n    --> [ (2, 6), (3, 7) ]\n\n",
                "type": "Tree a -> Tree (a -> b) -> Tree b"
            },
            {
                "name": "andThen",
                "comment": " Map given function onto a `Tree` and flatten the result.\n\n    import Lazy.LList as LL\n\n    singleton \"foo\"\n        |> insert (singleton \"bar\")\n        |> insert (singleton \"baz\")\n        |> andThen (\\a -> tree a <| LL.fromList [ singleton <| a ++ \" fighter\" ])\n        |> children\n    --> [ \"foo fighter\", \"bar\", \"baz\" ]\n\n",
                "type": "(a -> Tree b) -> Tree a -> Tree b"
            },
            {
                "name": "build",
                "comment": " Build `Tree` using custom constructor.\n\nThis can be for instance used to build `Tree` from other recursive data structre:\n\n    type Item = Item String (List Item)\n\n    getChildren (Item _ children) = children\n\n    Item \"foo\" [ Item \"bar\" [], Item \"baz\" []]\n        |> build getChildren\n        |> children\n    -> [ Item \"bar\" [], Item \"baz\" [] ]\n\nOr lookups to some other data structure.\n\n    import Dict exposing (Dict)\n\n    rootItem : String\n    rootItem = \"foo\"\n\n    childrenDict : Dict String (List String)\n    childrenDict = Dict.fromList [ (\"foo\", [ \"bar\", \"baz\" ]) ]\n\n    build (Maybe.withDefault [] << flip Dict.get childrenDict) rootItem\n        |> children\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "(a -> List a) -> a -> Tree a"
            },
            {
                "name": "children",
                "comment": " Obtain children items of `Tree`.\n\n    singleton \"foo\"\n        |> insert (singleton \"bar\")\n        |> insert (singleton \"baz\")\n        |> children\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "Tree a -> List a"
            },
            {
                "name": "descendants",
                "comment": " Obtain descendants as `Forest` from the `Tree`.\n\n    import Lazy.LList as LL\n\n    singleton \"foo\"\n        |> insert (singleton \"bar\")\n        |> insert (singleton \"baz\")\n        |> descendants\n        |> LL.map item\n        |> LL.toList\n    --> [ \"bar\", \"baz\" ]\n\n    singleton \"foo\"\n        |> insert (singleton \"bar\" |> insert (singleton \"baz\"))\n        |> descendants\n        |> LL.map (children)\n        |> LL.toList\n    --> [ [ \"baz\" ] ]\n\n",
                "type": "Tree a -> Forest a"
            },
            {
                "name": "filter",
                "comment": " Filter `Tree` children by given function.\n\nThis function goes from children of root downwards.\nThis means that nodes that doesn't satisfy predicate\nare excluded and filter is never performed over their children\neven if on those it might pass.\n\n    import Lazy.LList as LL\n\n    tree 1 (LL.fromList [ singleton 2, singleton 3, singleton 4 ])\n        |> filter ((>) 4)\n        |> children\n    --> [ 2, 3 ]\n\n    tree 1 (LL.fromList [ insert (singleton 5) <| singleton 2, insert (singleton 6) <| singleton 3, singleton 4 ])\n        |> filter ((<) 2)\n        |> descendants\n        |> LL.map children\n        |> LL.toList\n    --> [ [ 6 ], [] ]\n\n",
                "type": "(a -> Bool) -> Tree a -> Tree a"
            },
            {
                "name": "filterMap",
                "comment": " FilterMap on `Tree`. Works similarly to `List.filterMap` with same properties as [filter](#filter).\nIn case of `filterMap` even root node has to satisfy predicate otherwise\n`Nothing` is returned.\n\n    import Lazy.LList as LL\n\n    tree 1 (LL.fromList [ singleton 2, singleton 3, singleton 4 ])\n        |> filterMap (\\a -> if a < 4 then Just (a * 2) else Nothing)\n        |> Maybe.map children\n    --> Just [ 4, 6 ]\n\n    tree 1 (LL.fromList [ singleton 2, singleton 3, singleton 4 ])\n        |> filterMap (\\a -> if a > 2 then Just (a * 2) else Nothing)\n        |> Maybe.map children\n    --> Nothing\n\n",
                "type": "(a -> Maybe b) -> Tree a -> Maybe (Tree b)"
            },
            {
                "name": "flatten",
                "comment": " Flatten `Tree` of Trees.\n\n    singleton (singleton 1)\n        |> flatten\n        |> item\n    --> 1\n\n    import Lazy.LList as LL\n\n    tree (tree \"foo\" <| LL.fromList [ singleton \"bar\"]) (LL.fromList [ singleton <| singleton \"baz\" ])\n        |> flatten\n        |> children\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "Tree (Tree a) -> Tree a"
            },
            {
                "name": "forestMap",
                "comment": " Map function over `Forest`.\n\n    import Lazy.LList as LL\n\n    [ 1, 2, 3 ]\n        |> fromList (\\m _ -> m == Nothing)\n        |> forestMap ((+) 1)\n        |> LL.map item\n        |> LL.toList\n    --> [ 2, 3, 4 ]\n\n",
                "type": "(a -> b) -> Forest a -> Forest b"
            },
            {
                "name": "forestMap2",
                "comment": " Map function over two `Forest`s.\n\n    import Lazy.LList as LL\n\n    [ 1, 2, 3 ]\n        |> fromList (\\m _ -> m == Nothing)\n        |> forestMap2 (+) (fromList (\\m _ -> m == Nothing) [1, 2])\n        |> LL.map item\n        |> LL.toList\n    --> [ 2, 4 ]\n\n",
                "type": "(a -> b -> c) -> Forest a -> Forest b -> Forest c"
            },
            {
                "name": "fromList",
                "comment": " Construct `Forest` from a list.\n\n    import Lazy.LList as LL\n\n    [ { id = 1, parent = Nothing }\n    , { id = 2, parent = Nothing }\n    , { id = 3, parent = Just 1 }\n    ]\n        |> fromList (\\p i -> Maybe.map .id p == i.parent)\n        |> LL.map (.id << item)\n        |> LL.toList\n    --> [ 1, 2 ]\n\n    [ { id = 1, parent = Nothing }\n    , { id = 2, parent = Nothing }\n    , { id = 3, parent = Just 1 }\n    , { id = 4, parent = Just 1 }\n    , { id = 5, parent = Just 2 }\n    ]\n        |> fromList (\\p i -> Maybe.map .id p == i.parent)\n        |> LL.andThen descendants\n        |> LL.map (.id << item)\n        |> LL.toList\n    --> [ 3, 4, 5 ]\n\n",
                "type": "(Maybe a -> a -> Bool) -> List a -> Forest a"
            },
            {
                "name": "insert",
                "comment": " Insert one `Tree` as children another.\n\n    singleton 1\n        |> insert (singleton 2)\n        |> insert (singleton 3)\n        |> children\n    --> [ 2, 3 ]\n\n    singleton 1\n        |> insert (singleton 2)\n        |> item\n    --> 1\n\n",
                "type": "Tree a -> Tree a -> Tree a"
            },
            {
                "name": "isEmpty",
                "comment": " Check if `Tree` doesn't have any child.\n\n    singleton \"foo\"\n        |> isEmpty\n    --> True\n\n    singleton \"foo\"\n        |> insert (singleton \"bar\")\n        |> isEmpty\n    --> False\n\n",
                "type": "Tree a -> Bool"
            },
            {
                "name": "item",
                "comment": " Obtain item from `Tree`.\n\n    singleton \"foo\"\n        |> item\n        |> \"foo\"\n\n",
                "type": "Tree a -> a"
            },
            {
                "name": "map",
                "comment": " Map function over `Tree`.\n\n    singleton 1\n        |> map ((+) 1)\n        |> item\n    --> 2\n\n    singleton 1\n        |> insert (singleton 2)\n        |> insert (singleton 3)\n        |> map ((*) 2)\n        |> children\n    --> [ 4, 6 ]\n\n",
                "type": "(a -> b) -> Tree a -> Tree b"
            },
            {
                "name": "map2",
                "comment": " Map function over two `Tree`s\n\n    map2 (+) (singleton 1) (singleton 5)\n        |> item\n    --> 6\n\n    import Lazy.LList as LL\n\n    tree 1 (LL.fromList [ singleton 2, singleton 3, singleton 4 ])\n        |> map2 (+) (tree 5 <| LL.fromList [ singleton 6, singleton 7 ])\n        |> children\n    --> [ 8, 10 ]\n\n",
                "type": "(a -> b -> c) -> Tree a -> Tree b -> Tree c"
            },
            {
                "name": "singleton",
                "comment": " Puts value in minimal `Tree` context\n\n    singleton \"foo\"\n        |> item\n    --> \"foo\"\n\n",
                "type": "a -> Tree a"
            },
            {
                "name": "sort",
                "comment": " Sort `tree`.\n\n    singleton 10\n        |> insert (singleton 5)\n        |> insert (singleton 2)\n        |> sort\n        |> children\n    --> [ 2, 5 ]\n\nit applies all levels:\n\n    import Lazy.LList as LL\n\n    singleton 10\n        |> insert (tree 20 <| LL.llist (List.reverse << List.map singleton << List.range 1) 5)\n        |> sort\n        |> descendants\n        |> LL.map children\n        |> LL.toList\n    --> [ [ 1, 2, 3, 4, 5 ] ]\n\n",
                "type": "Tree comparable -> Tree comparable"
            },
            {
                "name": "sortBy",
                "comment": " Sort `Tree` by a function.\n\n    singleton { val = 10 }\n       |> insert (singleton { val = 7 })\n       |> insert (singleton { val = 3 })\n       |> sortBy .val\n       |> children\n    --> [ { val = 3 }, { val = 7 } ]\n\nit applies to all levels:\n\n    import Lazy.LList as LL\n\n    singleton { a = 10 }\n        |> insert (tree { a = 20 } <| LL.llist (List.reverse << List.map (\\v -> singleton { a = v }) << List.range 1) 3)\n        |> sortBy .a\n        |> descendants\n        |> LL.map children\n        |> LL.toList\n    --> [ [ { a = 1 }, { a = 2 }, { a = 3 } ] ]\n\n",
                "type": "(a -> comparable) -> Tree a -> Tree a"
            },
            {
                "name": "sortWith",
                "comment": " Sort `Tree` using custom Ordering function\n\n    flippedComparison : comparable -> comparable -> Order\n    flippedComparison a b =\n        case Basics.compare a b of\n            LT -> GT\n            EQ -> EQ\n            GT -> LT\n\n    singleton 10\n        |> insert (singleton 2)\n        |> insert (singleton 5)\n        |> sortWith flippedComparison\n        |> children\n    --> [ 5, 2 ]\n\n",
                "type": "(a -> a -> Order) -> Tree a -> Tree a"
            },
            {
                "name": "tree",
                "comment": " General `Tree` constructor.\n\n    import Lazy.LList as LL\n\n    tree \"foo\" LL.empty\n        |> item\n    --> \"foo\"\n\n    fromList (\\m _ -> m == Nothing) [ \"bar\", \"baz\" ]\n        |> tree \"foo\"\n        |> children\n    --> [ \"bar\", \"baz\" ]\n\n",
                "type": "a -> Forest a -> Tree a"
            }
        ],
        "binops": []
    },
    {
        "name": "Lazy.LList",
        "comment": " This module implements lazy construction of strict List.\nIt is not Lazy List implementation and it has different characteristics.\nIt's mostly intended for internal purposes of this library and is exposed\njust in case some additional user extensions will need it.\n\n\n# Types & Constructors\n\n@docs LList, empty, singleton, llist, isEmpty, fromList\n\n\n# Operations\n\n@docs cons, append\n\n\n# Query\n\n@docs isEmpty, toList, head, tail\n\n\n# Transformations\n\n@docs map, map2, filter, filterMap, reverse, sort, sortBy, sortWith, foldr, foldl, lazyFoldr, lazyFoldl, concat, andThen\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "LList",
                "comment": " **`LList` uses lazy implementation and therefore can't be compared using `==`**\n",
                "args": [
                    "a"
                ],
                "type": "Lazy (List a)"
            }
        ],
        "values": [
            {
                "name": "andThen",
                "comment": " Map `LList` construction over `LList`.\n\n    cons \"foo\" (cons \"bar\" <| singleton \"baz\")\n        |> andThen (\\a -> cons a <| singleton (a ++ \" fighter\" ))\n        |> toList\n    --> [ \"foo\", \"foo fighter\", \"bar\", \"bar fighter\", \"baz\", \"baz fighter\" ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> LList b) -> LList a -> LList b"
            },
            {
                "name": "append",
                "comment": " Append `LList` to `LList`.\n\n    append (singleton \"foo\") (fromList [ \"bar\", \"baz\" ])\n        |> toList\n    --> [ \"foo\", \"bar\", \"baz\" ]\n\nThis function is performed lazily.\n\n",
                "type": "LList a -> LList a -> LList a"
            },
            {
                "name": "concat",
                "comment": " Flatten `LList`.\n\n    fromList [ singleton \"foo\", cons \"bar\" <| singleton \"baz\" ]\n       |> concat\n       |> toList\n    --> [ \"foo\", \"bar\", \"baz\" ]\n\nThis function is performed lazily.\n\n",
                "type": "LList (LList a) -> LList a"
            },
            {
                "name": "cons",
                "comment": " Add element to `LList`.\n\n    empty\n        |> cons \"bar\"\n        |> cons \"foo\"\n        |> toList\n    --> [ \"foo\", \"bar\" ]\n\nThis function is performed lazily.\n\n",
                "type": "a -> LList a -> LList a"
            },
            {
                "name": "empty",
                "comment": " Init empty `LList`.\n\n    toList empty\n    --> []\n\n",
                "type": "LList a"
            },
            {
                "name": "filter",
                "comment": " Filter `LList`.\n\n    (cons 1 <| cons 2 <| cons 3 empty)\n        |> filter ((<) 1)\n        |> toList\n    --> [ 2, 3 ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> Bool) -> LList a -> LList a"
            },
            {
                "name": "filterMap",
                "comment": " Similar to `List.filterMap` but for `LList`.\n\n    (cons 1 <| cons 2 <| cons 3 empty)\n        |> filterMap (\\a -> if 1 < a then Just (2 * a) else Nothing)\n        |> toList\n    --> [ 4, 6 ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> Maybe b) -> LList a -> LList b"
            },
            {
                "name": "foldl",
                "comment": " Same as `List.foldl` but for `LLists`.\n\n    llist (List.range 0) 5\n        |> foldl (+) 0\n    --> 15\n\n    llist (List.range 0) 3\n        |> foldl (::) []\n    --> [ 3, 2, 1, 0 ]\n\nThis function forces evaluation.\n\n",
                "type": "(a -> b -> b) -> b -> LList a -> b"
            },
            {
                "name": "foldr",
                "comment": " Same as `List.foldr` but for `LLists`.\n\n    llist (List.range 0) 5\n        |> foldr (+) 0\n    --> 15\n\n    llist (List.range 0) 3\n        |> foldr (::) []\n    --> [ 0, 1, 2, 3 ]\n\nThis function forces evaluation.\n\n",
                "type": "(a -> b -> b) -> b -> LList a -> b"
            },
            {
                "name": "fromList",
                "comment": " Construct `LList` from `List`.\n\n    fromList [ \"foo\", \"bar\", \"baz\" ]\n        |> toList\n    --> [ \"foo\", \"bar\", \"baz\" ]\n\n",
                "type": "List a -> LList a"
            },
            {
                "name": "head",
                "comment": " Get first element from `LList`.\n\n    head empty\n    --> Nothing\n\n    llist (List.range 0) 2\n       |> head\n    --> Just 0\n\nThis function forces evaluation.\n\n",
                "type": "LList a -> Maybe a"
            },
            {
                "name": "isEmpty",
                "comment": " Check if `LList` is empty.\n\n    isEmpty empty\n    --> True\n\n    isEmpty (singleton \"foo\")\n    --> False\n\n    llist (List.filter <| \\a -> a > 10) [ 1, 2, 3 ]\n        |> isEmpty\n    --> True\n\nThis function forces evaluation.\n\n",
                "type": "LList a -> Bool"
            },
            {
                "name": "lazyFoldl",
                "comment": " Lazy variant of `foldl`.\n\nWorks only with lazy values.\n\n    import Lazy\n\n    llist (List.range 0) 5\n        |> lazyFoldl (\\a -> Lazy.map ((+) a)) (Lazy.lazy <| always 0)\n        |> Lazy.force\n    --> 15\n\nThis function is performed lazily.\n\n",
                "type": "(a -> Lazy b -> Lazy b) -> Lazy b -> LList a -> Lazy b"
            },
            {
                "name": "lazyFoldr",
                "comment": " Lazy variant of `foldr`.\n\nWorks only with lazy values.\n\n    import Lazy\n\n    llist (List.range 0) 5\n        |> lazyFoldr (\\a -> Lazy.map ((+) a)) (Lazy.lazy <| always 0)\n        |> Lazy.force\n    --> 15\n\nThis function is performed lazily.\n\n",
                "type": "(a -> Lazy b -> Lazy b) -> Lazy b -> LList a -> Lazy b"
            },
            {
                "name": "llist",
                "comment": " Init `LList` using constructor.\n\n`LList` is init as a function from `a -> List b`.\nEvaluation of this function is lazy and happens in time when\nactuall value is needed, not when constructor is called.\n\nFor instance you can use some `List` constructor:\n\n    llist (List.range 0) 5\n        |> toList\n    --> [ 0, 1, 2, 3, 4, 5 ]\n\nOr use any other function you need`List`:\n\n    llist (List.filter <| \\a -> a % 2 == 0) (List.range 0 10)\n        |> toList\n    --> [ 0, 2, 4, 6, 8, 10 ]\n\n",
                "type": "(a -> List b) -> a -> LList b"
            },
            {
                "name": "map",
                "comment": " Map function over `LList`.\n\n    llist (List.range 0) 5\n        |> map ((*) 2)\n        |> toList\n    --> [ 0, 2, 4, 6, 8, 10 ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> b) -> LList a -> LList b"
            },
            {
                "name": "map2",
                "comment": " Map two functions over `LList`.\n\n    llist (List.range 0) 5\n        |> map2 (+) (llist (List.range 0) 5)\n        |> toList\n    --> [ 0, 2, 4, 6, 8, 10 ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> b -> c) -> LList a -> LList b -> LList c"
            },
            {
                "name": "reverse",
                "comment": " Reverse `LList`.\n\n    fromList [ 1, 2, 3 ]\n        |> reverse\n        |> toList\n    --> [ 3, 2, 1 ]\n\nThis function is performed lazily.\n\n",
                "type": "LList a -> LList a"
            },
            {
                "name": "singleton",
                "comment": " Init singleton `LList`.\n\n    singleton \"foo\"\n        |> toList\n    --> [ \"foo\" ]\n\n",
                "type": "a -> LList a"
            },
            {
                "name": "sort",
                "comment": " Sort by for `LList`.\n\n    fromList [ 3, 1, 2 ]\n        |> sort\n        |> toList\n    --> [ 1, 2, 3 ]\n\nThis function is performed lazily.\n\n",
                "type": "LList comparable -> LList comparable"
            },
            {
                "name": "sortBy",
                "comment": " Sort by for `LList`.\n\n    fromList [ 3, 1, 2 ]\n        |> sortBy identity\n        |> toList\n    --> [ 1, 2, 3 ]\n\n    fromList [ { val = \"c\"} , { val = \"b\"}, { val = \"a\"} ]\n        |> sortBy .val\n        |> toList\n    -->  [ { val = \"a\"}, { val = \"b\"}, { val = \"c\"} ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> comparable) -> LList a -> LList a"
            },
            {
                "name": "sortWith",
                "comment": " Sort with for `LList`\n\n    flippedComparison : comparable -> comparable -> Order\n    flippedComparison a b =\n        case Basics.compare a b of\n            LT -> GT\n            EQ -> EQ\n            GT -> LT\n\n    llist (List.range 1) 5\n        |> sortWith flippedComparison\n        |> toList\n    --> [ 5, 4, 3, 2, 1 ]\n\nThis function is performed lazily.\n\n",
                "type": "(a -> a -> Order) -> LList a -> LList a"
            },
            {
                "name": "tail",
                "comment": " Get first element from `LList`.\n\n    tail empty\n    --> Nothing\n\n    tail (singleton \"foo\")\n        |> Maybe.map toList\n    --> Just []\n\n    llist (List.range 0) 2\n        |> tail\n        |> Maybe.map toList\n    --> Just [ 1, 2 ]\n\nThis function forces evaluation.\n\n",
                "type": "LList a -> Maybe (LList a)"
            },
            {
                "name": "toList",
                "comment": " Build `List` from `LList`.\n\n    toList empty\n    --> []\n\n    toList <| llist (List.range 0) 2\n    --> [ 0, 1, 2 ]\n\nThis function forces evaluation.\n\n",
                "type": "LList a -> List a"
            }
        ],
        "binops": []
    }
]