package exenum
Build efficient enumerations for datatypes. Inspired by Feat for Haskell.
Install
Dune Dependency
Authors
Maintainers
Sources
v0.82.0.tar.gz
sha256=ab25cd106937fefef265abc6e7157a1d48c5ea6663fab7d782914d9659ff4aee
md5=5367c3fe8d5a3b645c719b48889a6fce
doc/src/exenum.internals/shuffle.ml.html
Source file shuffle.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
open Convenience open Big_int (*** Shuffle, deterministically, the values inside parts. ***) (* Starting from x, find a number prime with y. *) let rec find_prime x y = let gcd = gcd_big_int x y in if is_bigone gcd then x else find_prime (succ x) y let compute_shuffle card compute = (* Find a number within the order of magnitude of sqrt(card) * and that is prime with card. *) let prime = find_prime (sqrt_big_int card) card in fun index -> let new_index = bigmod (index ** prime) card in compute new_index
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>