[
    {
        "name": "MultiwayTreeZipper",
        "comment": " A library for navigating and updating immutable trees. The elements in\nthe tree must have the same type. The trees are implemented in a Huet\nZipper fashion.\n\n# Types\n@docs Context, Breadcrumbs, Zipper\n\n# Navigation API\n@docs goToChild, goUp, goToRoot, goLeft, goRight, goToNext, goToPrevious, goToRightMostChild\n\n# Update API\n@docs updateDatum, replaceDatum\n\n# Access API\n@docs datum, maybeDatum\n\n\n# References\n[The Zipper, Gerard Huet](https://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf)\n[Learn You A Haskell, Zippers, Miran Lipovaca](http://learnyouahaskell.com/zippers)\n\n# Future work\nMight be able to integrate existing [Rose Tree](http://package.elm-lang.org/packages/TheSeamau5/elm-rosetree) to work with the Zipper.\nWanted the first version to be self contained.\n\n",
        "unions": [
            {
                "name": "Context",
                "comment": " The necessary information needed to reconstruct a MultiwayTree as it is\nnavigated with a Zipper. This context includes the datum that was at the\nprevious node, a list of children that came before the node, and a list of\nchildren that came after the node.\n",
                "args": [
                    "a"
                ],
                "cases": [
                    [
                        "Context",
                        [
                            "a",
                            "List (Tree a)",
                            "List (Tree a)"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Breadcrumbs",
                "comment": " A list of Contexts that is contructed as a MultiwayTree is navigated.\nBreadcrumbs are used to retain information about parts of the tree that move out\nof focus. As the tree is navigated, the needed Context is pushed onto the list\nBreadcrumbs, and they are maintained in the reverse order in which they are\nvisited\n",
                "args": [
                    "a"
                ],
                "type": "List (Context a)"
            },
            {
                "name": "Zipper",
                "comment": " A structure to keep track of the current Tree, as well as the Breadcrumbs to\nallow us to continue navigation through the rest of the tree.\n",
                "args": [
                    "a"
                ],
                "type": "( Tree a, Breadcrumbs a )"
            }
        ],
        "values": [
            {
                "name": "datum",
                "comment": " Access the datum at the current Zipper focus.\n",
                "type": "Zipper a -> a"
            },
            {
                "name": "goLeft",
                "comment": " Move left relative to the current Zipper focus. This allows navigation from\na child to it's previous sibling.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 1\n        &> goLeft\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goRight",
                "comment": " Move right relative to the current Zipper focus. This allows navigation from\na child to it's next sibling.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 1\n        &> goRight\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goToChild",
                "comment": " Move down relative to the current Zipper focus. This allows navigation from\na parent to it's children.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 1\n",
                "type": "Int -> Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goToNext",
                "comment": " Moves to the next node in the hierarchy, depth-first. If already\n  at the end, stays there.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToNext\n        &> goToNext\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goToPrevious",
                "comment": " Moves to the previous node in the hierarchy, depth-first.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 2\n        &> goToPrevious\n        &> goToPrevious\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goToRightMostChild",
                "comment": " Move down and as far right as possible relative to the current Zipper focus. \nThis allows navigation from a parent to it's last child.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToRightMostChild\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goToRoot",
                "comment": " Move to the root of the current Zipper focus. This allows navigation from\nany part of the tree back to the root.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\"\n                [ Tree \"e\" [] ]\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 0\n        &> goToChild 1\n        &> goToRoot\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "goUp",
                "comment": " Move up relative to the current Zipper focus. This allows navigation from a\nchild to it's parent.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\" []\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 0\n        &> goUp\n",
                "type": "Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "maybeDatum",
                "comment": " Access the datum at the current Zipper focus as a Maybe.\n",
                "type": "Zipper a -> Maybe a"
            },
            {
                "name": "replaceDatum",
                "comment": " Replace the datum at the current Zipper focus. This allows complete\nreplacement of a node's datum information, ignoring the previous state of the\nnode.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\"\n                [ Tree \"e\" [] ]\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 0\n        &> replaceDatum \"X\" -- Replaces \"b\" with \"X\"\n        &> goToRoot\n",
                "type": "a -> Zipper a -> Maybe (Zipper a)"
            },
            {
                "name": "updateDatum",
                "comment": " Update the datum at the current Zipper focus. This allows changes to be made\nto a part of a node's datum information, given the previous state of the node.\n\n    (&>) = Maybe.andThen\n\n    simpleTree =\n        Tree \"a\"\n            [ Tree \"b\"\n                [ Tree \"e\" [] ]\n            , Tree \"c\" []\n            , Tree \"d\" []\n            ]\n\n    Just (simpleTree, [])\n        &> goToChild 0\n        &> updateDatum (\\old -> old ++ \"X\") -- Appends an X to \"b\"\n        &> goToRoot\n",
                "type": "(a -> a) -> Zipper a -> Maybe (Zipper a)"
            }
        ],
        "binops": []
    },
    {
        "name": "MultiwayTree",
        "comment": " A library for constructing multi-way trees. Each Tree carries two pieces of\ninformation, it's datum and children.\n\n\n# Types\n@docs Tree, Forest\n\n# Operations\n@docs datum, children, foldl, foldr, flatten, filter, filterWithChildPrecedence\n\n# Mapping\n@docs map\n",
        "unions": [
            {
                "name": "Tree",
                "comment": " A type to keep track of datum and children.\n",
                "args": [
                    "a"
                ],
                "cases": [
                    [
                        "Tree",
                        [
                            "a",
                            "Forest a"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Forest",
                "comment": " A list of Trees. Convenient for describing children.\n",
                "args": [
                    "a"
                ],
                "type": "List (Tree a)"
            }
        ],
        "values": [
            {
                "name": "children",
                "comment": " Access the children of the current tree\n",
                "type": "Tree a -> Forest a"
            },
            {
                "name": "datum",
                "comment": " Access the datum of the current tree\n",
                "type": "Tree a -> a"
            },
            {
                "name": "filter",
                "comment": " Filter the MultiwayTree. Keep only elements whose datum satisfy the predicate.\n",
                "type": "(a -> Bool) -> Tree a -> Maybe (Tree a)"
            },
            {
                "name": "filterWithChildPrecedence",
                "comment": " Filter the MultiwayTree. If the predicate is True for a Child the entire path to the root will be part of the result Tree.\n",
                "type": "(a -> Bool) -> Tree a -> Maybe (Tree a)"
            },
            {
                "name": "flatten",
                "comment": " Flattens a Tree into a List where the root is the first element of that list.\n",
                "type": "Tree a -> List a"
            },
            {
                "name": "foldl",
                "comment": " Reduce a Tree from the left.\n",
                "type": "(a -> b -> b) -> b -> Tree a -> b"
            },
            {
                "name": "foldr",
                "comment": " Reduce a Tree from the right.\n",
                "type": "(a -> b -> b) -> b -> Tree a -> b"
            },
            {
                "name": "map",
                "comment": " Map over the MultiwayTree\n",
                "type": "(a -> b) -> Tree a -> Tree b"
            }
        ],
        "binops": []
    }
]