[{"name":"HTree","comment":"\n\nConvert hierarchical lists to a rose tree,\nconvert a rose tree to a list of node labels,\nconvert a rose tree to a string representing the\ncorresponding outline, etc. See HTreeExample.elm.\n\n@docs fromList, toList, toOutline, tag, depth, nodeCount\n\n","unions":[],"aliases":[],"values":[{"name":"depth","comment":" depth t is the depth of the tree.\n\n    > depth t\n    2 : I\n","type":"Tree.Tree a -> Basics.Int"},{"name":"fromList","comment":"  Suppose give an list of items of type `a`, a \"root\" element\nof type `a`, and a function that determines the level of an item.\nThe function `fromList` returns  the corresponding rose tree.\nFor an example, consider the outline given by the string\n`Example.Test.o3:\n\n    A\n      p\n        1\n        2\n        3\n      q\n    B\n      r\n      s\n    C\n\nThen we have\n\n    > import HTree exposing(..)\n    > import HTree.String as HS\n    > import Example.Test as Example\n\n    > data = String.split \"\\n\" o2 |> List.filter (\\line -> line /= \"\")\n    [\"A\",\"  p\",\"  q\",\"B\",\"  r\",\"  s\",\"C\"]\n        : List String\n\n    > t = fromList \"*\" HS.level data\n    Tree \"*\"\n       [Tree \"A\" [Tree (\"  p\") [],Tree (\"  q\") []]\n       ,Tree \"B\" [Tree (\"  r\") [],Tree (\"  s\") []]\n       ,Tree \"C\" []]\n\nThe function `HS.level` returns the number of leading spaces divided by 2 --\ninteger division, no remainder.\n","type":"a -> (a -> Basics.Int) -> List.List a -> Tree.Tree a"},{"name":"nodeCount","comment":" nodecount t is the number of notes in the tree t\n\n    > nodeCount t\n    8 : Int\n\nThe count includes the root.\n","type":"Tree.Tree a -> Basics.Int"},{"name":"tag","comment":" The `tag` function transforms a tree of items into\na tree of tuples of the form `(a, k)`, where `k` is the\ndepth of `a` in the tree.\n\n    > tag (Tree.map String.trim t)\n      Tree (\"*\",0) [\n        Tree (\"A\",1) [Tree (\"p\",2) [],Tree (\"q\",2) []]\n       ,Tree (\"B\",1) [Tree (\"r\",2) [],Tree (\"s\",2) []]\n       ,Tree (\"C\",1) []]\n\n","type":"Tree.Tree a -> Tree.Tree ( a, Basics.Int )"},{"name":"toList","comment":" Map a tree to a list of node contents:\n\n    > import Tree\n\n    > t |> Tree.map (\\label -> String.trim label)\n      Tree \"*\" [\n         Tree \"A\" [Tree \"p\" [],Tree \"q\" []]\n        ,Tree \"B\" [Tree \"r\" [],Tree \"s\" []]\n        ,Tree \"C\" []]\n\n     > t |> Tree.map (\\label -> String.trim label) |> toList\n       [\"*\",\"A\",\"p\",\"q\",\"B\",\"r\",\"s\",\"C\"]\n\n","type":"Tree.Tree b -> List.List b"},{"name":"toOutline","comment":" Given a function that maps labels to strings, construct\na string that represents the tree as an outline.\n\n    > t |> toOutline identity\n    \"*\\nA\\n    p\\n    q\\nB\\n    r\\n    s\\nC\" : String\n\nThe string returned is\n\n    *\n        A\n            p\n            q\n        B\n            r\n            s\n        C\n","type":"(a -> String.String) -> Tree.Tree a -> String.String"}],"binops":[]},{"name":"HTree.String","comment":"  HTree.String has some convenience functions for dealing with\noutlines and trees whose nodes are labeled by strings.\n\n\n@docs parse, toString, toOutline, level\n\n","unions":[],"aliases":[],"values":[{"name":"level","comment":" Compute the level of a string: the number of\nleading spaces, divided by 2\n","type":"String.String -> Basics.Int"},{"name":"parse","comment":"\n\n    > import HTree.String exposing(..)\n    > import Example.Test exposing(..)\n\n    o3 = -- from Example.Test\n    A\n      p\n        1\n        2\n        3\n      q\n    B\n      r\n      s\n    C\n\n    > t = parse o3\n      Tree \"*\" [\n         Tree \"A\" [Tree \"p\" [Tree \"1\" [],Tree \"2\" [],Tree \"3\" []],Tree \"q\" []]\n        ,Tree \"B\" [Tree \"r\" [],Tree \"s\" []]\n        ,Tree \"C\" []]\n\n    > t = parse o3 |> HTree.tag\n      Tree (\"*\",0) [\n         Tree (\"A\",1) [Tree (\"p\",2) [Tree (\"1\",3) [],Tree (\"2\",3) [],Tree (\"3\",3) []]],Tree (\"q\",1) []\n        ,Tree (\"B\",1) [Tree (\"r\",2) [],Tree (\"s\",2) []]\n        ,Tree (\"C\",1) []]\n\n","type":"String.String -> Tree.Tree String.String"},{"name":"toOutline","comment":" Compute the string representation of a tree labeled by strings;\nomit the root label\n\n    > toOutline t\n    \"A\\n  p\\n    1\\n    2\\n    3\\n  q\\nB\\n  r\\n  s\\nC\" : String\n","type":"Tree.Tree String.String -> String.String"},{"name":"toString","comment":" Compute the string representation of a tree labeled by strings\n\n    > toString t\n    \"*\\nA\\n  p\\n    1\\n    2\\n    3\\n  q\\nB\\n  r\\n  s\\nC\" : String\n\n","type":"Tree.Tree String.String -> String.String"}],"binops":[]}]