[{"name":"Rope","comment":"\n\n\n# Types\n\n@docs Rope\n\n\n# Create\n\n@docs empty, singleton, append, prepend, fromList, fromRopeList\n\n\n# Transform\n\n@docs map, indexedMap, foldl, foldr, filter, filterMap, toList\n\n\n# Utilities\n\n@docs length, reverse, member, all, any, maximum, minimum, sum, product\n\n\n# Combine\n\n@docs appendTo, prependTo, concat, concatMap\n\n\n# Deconstruct\n\n@docs isEmpty\n\n","unions":[{"name":"Rope","comment":" A `Rope` is similar to a list, but has fast (constant time) concatenation at both ends, and fast concatenation of two `Rope`s.\n\nIt's slightly slower (O(n + operations) instead of O(n)) to iterate through, so you should convert it to a `List` if you plan to use it repeatedly.\n\nInternally the `Rope` is a tree of lists.\n\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"all","comment":" Determine if all elements satisfy some test.\n\n    all (\\n -> modBy 2 n == 0) (fromList [ 2, 4 ])\n    --> True\n    all (\\n -> modBy 2 n == 0) (fromList [ 2, 3 ])\n    --> False\n    all (\\n -> modBy 2 n == 0) (fromList [])\n    --> True\n\n","type":"(a -> Basics.Bool) -> Rope.Rope a -> Basics.Bool"},{"name":"any","comment":" Determine if any elements satisfy some test.\n\n    any (\\n -> modBy 2 n == 0) (fromList [ 2, 3 ])\n    --> True\n\n    any (\\n -> modBy 2 n == 0) (fromList [ 1, 3 ])\n    --> False\n\n    any (\\n -> modBy 2 n == 0) (fromList [])\n    --> False\n\n","type":"(a -> Basics.Bool) -> Rope.Rope a -> Basics.Bool"},{"name":"append","comment":" Add an element to the end of a list.\n\n    append 1 (fromList [2,3]) |> toList\n    --> [2,3,1]\n    append 1 empty |> toList\n    --> [1]\n\nComplexity: O(1)\n\n","type":"a -> Rope.Rope a -> Rope.Rope a"},{"name":"appendTo","comment":" Put two ropes together, the second after the first.\n\n    appendTo (fromList [ 1, 1, 2 ]) (fromList [ 3, 5, 8 ]) |> toList\n    --> [ 1, 1, 2, 3, 5, 8 ]\n\n    appendTo (fromList [ 'a', 'b' ]) (fromList [ 'c' ]) |> toList\n    --> [ 'a', 'b', 'c' ]\n\nComplexity: O(1)\n\n","type":"Rope.Rope a -> Rope.Rope a -> Rope.Rope a"},{"name":"concat","comment":" Concatenate a bunch of ropes into a single rope:\n\n    concat (fromList [ fromList [ 1, 2 ], fromList [ 3 ], fromList [ 4, 5 ] ]) |> toList\n    --> [ 1, 2, 3, 4, 5 ]\n\nComplexity: O(n), in practice it can be O(1) if the top level is the result of `fromList`\n\n","type":"Rope.Rope (Rope.Rope a) -> Rope.Rope a"},{"name":"concatMap","comment":" Map a given function onto a list and flatten the resulting ropes.\n\n    concatMap f xs == concat (map f xs)\n\n","type":"(a -> Rope.Rope b) -> Rope.Rope a -> Rope.Rope b"},{"name":"empty","comment":" An empty rope.\n","type":"Rope.Rope a"},{"name":"filter","comment":" Keep elements that satisfy the test.\n\n    filter (\\n -> modBy 2 n == 0) (fromList [ 1, 2, 3, 4, 5, 6 ]) |> toList\n    --> [ 2, 4, 6 ]\n\n","type":"(a -> Basics.Bool) -> Rope.Rope a -> Rope.Rope a"},{"name":"filterMap","comment":" Filter out certain values. For example, maybe you have a bunch of strings\nfrom an untrusted source and you want to turn them into numbers:\n\n    numbers : Rope Int\n    numbers =\n        filterMap String.toInt (fromList [ \"3\", \"hi\", \"12\", \"4th\", \"May\" ])\n\n    numbers -> fromList [ 3, 12 ]\n\n","type":"(a -> Maybe.Maybe b) -> Rope.Rope a -> Rope.Rope b"},{"name":"foldl","comment":" Reduce a rope from the left.\n\n    foldl (+) 0 (fromList [ 1, 2, 3 ])\n    --> 6\n\n    foldl (::) [] (fromList [ 1, 2, 3 ])\n    --> [ 3, 2, 1 ]\n\nSo `foldl step state [1,2,3]` is like saying:\n\n    state\n        |> step 1\n        |> step 2\n        |> step 3\n\nComplexity: O(n)\n\n","type":"(a -> b -> b) -> b -> Rope.Rope a -> b"},{"name":"foldr","comment":" Reduce a rope from the right.\n\n    foldr (+) 0 (fromList [ 1, 2, 3 ])\n    --> 6\n\n    foldr (::) [] (fromList [ 1, 2, 3 ])\n    --> [ 1, 2, 3 ]\n\nSo `foldr step state [1,2,3]` is like saying:\n\n    state\n        |> step 3\n        |> step 2\n        |> step 1\n\n","type":"(a -> b -> b) -> b -> Rope.Rope a -> b"},{"name":"fromList","comment":" Build a rope from a list.\n\nComplexity: O(1)\n\n","type":"List.List a -> Rope.Rope a"},{"name":"fromRopeList","comment":" Build a rope from a list of ropes.\n\nComplexity: O(1)\n\n","type":"List.List (Rope.Rope a) -> Rope.Rope a"},{"name":"indexedMap","comment":" Same as `map` but the function is also applied to the index of each\nelement (starting at zero).\n\n    indexedMap Tuple.pair (fromList [ \"Tom\", \"Sue\", \"Bob\" ]) |> toList\n    --> [ ( 0, \"Tom\" ), ( 1, \"Sue\" ), ( 2, \"Bob\" ) ]\n\nComplexity: O(n)\n\n","type":"(Basics.Int -> a -> b) -> Rope.Rope a -> Rope.Rope b"},{"name":"isEmpty","comment":" Determine if a rope is empty.\n\n    isEmpty (fromList [])\n    --> True\n\n    isEmpty (fromList [] |> appendTo (fromList []))\n    --> True\n\n","type":"Rope.Rope a -> Basics.Bool"},{"name":"length","comment":" Determine the length of a rope.\n\n    length (fromList [ 1, 2, 3 ])\n    --> 3\n\n","type":"Rope.Rope a -> Basics.Int"},{"name":"map","comment":" Apply a function to every element of a rope.\n\n    map sqrt (fromList [1,4,9]) |> toList\n    --> [1,2,3]\n\n    map not (fromList [True,False,True]) |> toList\n    --> [False,True,False]\n\nSo `map func (fromList [ a, b, c ])` is the same as `fromList [ func a, func b, func c ]`\n\nComplexity: O(n)\n\n","type":"(a -> b) -> Rope.Rope a -> Rope.Rope b"},{"name":"maximum","comment":" Find the maximum element in a non-empty rope.\n\n    maximum (fromList [ 1, 4, 2 ])\n    --> Just 4\n\n    maximum (fromList [])\n    --> Nothing\n\n","type":"Rope.Rope comparable -> Maybe.Maybe comparable"},{"name":"member","comment":" Figure out whether a rope contains a value.\n\n    member 9 (fromList [1,2,3,4])\n    --> False\n\n    member 4 (fromList [1,2,3,4])\n    --> True\n\n","type":"a -> Rope.Rope a -> Basics.Bool"},{"name":"minimum","comment":" Find the minimum element in a non-empty rope.\n\n    minimum (fromList [ 3, 2, 1 ])\n    --> Just 1\n\n    minimum (fromList [])\n    --> Nothing\n\n","type":"Rope.Rope comparable -> Maybe.Maybe comparable"},{"name":"prepend","comment":" Add an element to the front of a list.\n\n    prepend 1 (fromList [2,3]) |> toList\n    --> [1,2,3]\n    prepend 1 empty |> toList\n    --> [1]\n\nComplexity: O(1)\n\n","type":"a -> Rope.Rope a -> Rope.Rope a"},{"name":"prependTo","comment":" Put two ropes together, the first after the second.\n\n    prependTo (fromList [ 1, 1, 2 ]) (fromList [ 3, 5, 8 ]) |> toList\n    --> [ 3, 5, 8, 1, 1, 2 ]\n\n    prependTo (fromList [ 'a', 'b' ]) (fromList [ 'c' ]) |> toList\n    --> [ 'c', 'a', 'b' ]\n\nComplexity: O(1)\n\n","type":"Rope.Rope a -> Rope.Rope a -> Rope.Rope a"},{"name":"product","comment":" Get the product of the rope elements.\n\n    product (fromList [ 2, 2, 2 ])\n    --> 8\n\n    product (fromList [ 3, 3, 3 ])\n    --> 27\n\n    product (fromList [])\n    --> 1\n\n","type":"Rope.Rope number -> number"},{"name":"reverse","comment":" Reverse a rope.\n\n    reverse (fromList [ 1, 2, 3, 4 ]) |> toList\n    --> [ 4, 3, 2, 1 ]\n\n","type":"Rope.Rope a -> Rope.Rope a"},{"name":"singleton","comment":" Create a rope with only one element:\n\n    singleton 1234 |> toList\n    --> [ 1234 ]\n\n    singleton \"hi\" |> toList\n    --> [ \"hi\" ]\n\n","type":"a -> Rope.Rope a"},{"name":"sum","comment":" Get the sum of the rope elements.\n\n    sum (fromList [ 1, 2, 3 ])\n    --> 6\n\n    sum (fromList [ 1, 1, 1 ])\n    --> 3\n\n    sum (fromList [])\n    --> 0\n\n","type":"Rope.Rope number -> number"},{"name":"toList","comment":" Convert a rope into the equivalent list.\n\n    concat (fromList [ fromList [ 1, 2 ], fromList [ 3, 4 ] ]) |> toList\n    --> [ 1, 2, 3, 4 ]\n\nComplexity: O(n), in practice it can be O(1) if the top level is the result of `fromList`\n\n","type":"Rope.Rope a -> List.List a"}],"binops":[]}]