[{"name":"DisjointSet","comment":" A disjoint set implementation with path compression.\n\n@docs DisjointSet, empty, union, find, fromDict, toDict\n\n","unions":[{"name":"DisjointSet","comment":" The `DisjointSet` type definition.\n","args":["comparable"],"cases":[]}],"aliases":[],"values":[{"name":"empty","comment":" Creats an empty disjoint set.\n","type":"DisjointSet.DisjointSet comparable"},{"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":"comparable -> DisjointSet.DisjointSet comparable -> Maybe.Maybe comparable"},{"name":"fromDict","comment":" Creates a disjoint set from a dictionary of `(element, equivalent)` pairs.\n","type":"Dict.Dict comparable comparable -> DisjointSet.DisjointSet comparable"},{"name":"toDict","comment":" Creates a dictionary of `(element, equivalent)` pairs from a disjoint set.\n","type":"DisjointSet.DisjointSet comparable -> Dict.Dict comparable comparable"},{"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    import Dict\n\n    union \"a\" \"a\" empty |> toDict --> Dict.fromList [ (\"a\", \"a\") ]\n    union \"a\" \"b\" empty |> toDict --> Dict.fromList [ (\"a\", \"a\"), (\"b\", \"a\") ]\n\n    empty\n        |> union \"a\" \"b\"\n        |> union \"b\" \"c\"\n        |> toDict\n    --> Dict.fromList [ (\"a\", \"a\"), (\"b\", \"a\"), (\"c\", \"a\") ]\n\n    empty\n        |> union \"a\" \"b\"\n        |> union \"x\" \"y\"\n        |> union \"b\" \"y\"\n        |> toDict\n    --> Dict.fromList [ (\"a\", \"a\"), (\"b\", \"a\"), (\"x\", \"a\"), (\"y\", \"a\") ]\n\n","type":"comparable -> comparable -> DisjointSet.DisjointSet comparable -> DisjointSet.DisjointSet comparable"}],"binops":[]}]