[{"name":"DisjointSet","comment":" A disjoint set implementation with path compression.\n\n@docs DisjointSet, empty, union, find, fromList, toList\n\n","unions":[{"name":"DisjointSet","comment":" A data structure that stores non-overlapping sets.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"empty","comment":" Creats an empty disjoint set.\n","type":"DisjointSet.DisjointSet a"},{"name":"find","comment":" Finds the root element from a given element.\n\n    import Dict\n\n    set : DisjointSet String\n    set =\n        empty\n            |> union \"a\" \"b\"\n            |> union \"b\" \"c\"\n            |> union \"c\" \"d\"\n            |> union \"e\" \"e\"\n\n    find \"a\" set --> Just \"a\"\n    find \"b\" set --> Just \"a\"\n    find \"c\" set --> Just \"a\"\n    find \"d\" set --> Just \"a\"\n    find \"e\" set --> Just \"e\"\n    find \"x\" set --> Nothing\n\n","type":"a -> DisjointSet.DisjointSet a -> Maybe.Maybe a"},{"name":"fromList","comment":" Creates a disjoint set from a list of `(element, equivalent)` pairs.\n","type":"List.List ( a, a ) -> DisjointSet.DisjointSet a"},{"name":"toList","comment":" Creates a list of `(element, equivalent)` pairs from a disjoint set.\n","type":"DisjointSet.DisjointSet a -> List.List ( a, a )"},{"name":"union","comment":" Unifies two elements. If an element is not part of any set, it is created.\n\nThe root element is always the first element that was added.\n\nThis operation does path compression as an optimization.\n\n    union \"a\" \"a\" empty |> toList --> [ (\"a\", \"a\") ]\n    union \"a\" \"b\" empty |> toList --> [ (\"a\", \"a\"), (\"b\", \"a\") ]\n\n    empty\n        |> union \"a\" \"b\"\n        |> union \"b\" \"c\"\n        |> toList\n    --> [ (\"a\", \"a\"), (\"b\", \"a\"), (\"c\", \"a\") ]\n\n    empty\n        |> union \"a\" \"b\"\n        |> union \"x\" \"y\"\n        |> union \"b\" \"y\"\n        |> toList\n    --> [ (\"a\", \"a\"), (\"b\", \"a\"), (\"x\", \"a\"), (\"y\", \"a\") ]\n\n","type":"a -> a -> DisjointSet.DisjointSet a -> DisjointSet.DisjointSet a"}],"binops":[]}]