Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/kudzu-forest/elm-random-tree.
What we checked: Rebuilt with git archive from commit ce921ee5bf92 of https://github.com/kudzu-forest/elm-random-tree (zip prefix kudzu-forest-elm-random-tree-ce921ee/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 270e255f44195adf4d02408b8a27294f1c8206ad.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/kudzu-forest/elm-random-tree/zipball/3.0.0/
This module provides a data structure that allows for random selection from a collection of data in amortized O(log(N)) time. You can assign a weight to each element as a Float value.
The Tree in this module:
pick, take, drop, remove, and filter) return Maybe (Tree a) in the event that all elements are deleted.fromList requires a head element and a tail list (similar to Random.uniform or Random.weighted).Maybe would be more cumbersome.member and remove.Creates RandomTree.Weighted.Tree from a single element and its associated weight.
Creates a RandomTree.Weighted.Tree from a single element and a list of additional elements. This ensures that the tree is non-empty.
These functions all return Random.Generator.
Returns a Random.Generator that produces a tuple containing a random content from the tree and its associated weight.
Returns a Random.Generator that produces a tuple containing a randomly selected weighted content from the tree and a Maybe value representing the modified tree with that content removed.
Returns a Random.Generator that produces n weighted contents selected randomly from the tree. The result includes the remaining tree structure.
Returns Random.Generator that generates the argument tree whose n elements are removed randomly. The returned value is wrapped in Maybe just in case all the elements have been removed.
Maps the weighted contents of the tree using the provided function.
Maps the content of each element in the tree using the provided function.
Maps the weight of each element in the tree using the provided function.
Adjusts the total weight of the tree to the specified value.
Inserts a weighted element into the RandomTree.Weighted.Tree, adjusting the structure as needed.
Inserts all weighted elements from the provided list into the RandomTree.Weighted.Tree.
Merges two RandomTree.Weighted.Tree instances into a single tree, preserving weights of each elements.
These functions return Maybe if all elements are removed.
Removes all instances of the specified element from the RandomTree.Weighted.Tree. The result is wrapped in a Maybe type to indicate if the tree is empty after removal.
Filters the RandomTree.Weighted.Tree by removing elements that do not satisfy the provided predicate function. The result is wrapped in a Maybe type to indicate if the tree is empty after filtering.
RandomTree.Weighted.Treerepresents non-empty collection of randomly chosen values.