[
    {
        "name": "Arithmetic",
        "comment": " A library that provides useful number-theoretical functions for dealing\nwith integers, primes, divisibility, et cetera.\n\n# Primes\n@docs isPrime, primesBelow, primeFactors, primeExponents\n\n# Parity\n@docs isEven, isOdd\n\n# Divisors\n@docs divides, isMultipleOf, divisors, properDivisors, numDivisors\n\n# GCD and LCM\n@docs gcd, lcm, isCoprimeTo, totient\n\n# Base conversion\n@docs toBase, fromBase\n\n# Squares\n@docs intSquareRoot, exactIntSquareRoot, isSquare\n\n# Cubes\n@docs cbrt, intCubeRoot, exactIntCubeRoot, isCube\n\n# Modular arithmetic\n@docs powerMod\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "cbrt",
                "comment": " Take the cube root of a number.\n\n    cbrt 15.625 == 2.5\n",
                "type": "Float -> Float"
            },
            {
                "name": "divides",
                "comment": " Test whether one number divides another.\n\n    10 `divides` 120 == True\n    10 `divides` 125 == False\n",
                "type": "Int -> Int -> Bool"
            },
            {
                "name": "divisors",
                "comment": " Get all divisors of a number, in ascending order.\n\n    divisors 20 == [1, 2, 4, 5, 10, 20]\n",
                "type": "Int -> List Int"
            },
            {
                "name": "exactIntCubeRoot",
                "comment": " Integer cube root, returning `Nothing` if the given number is not a cube.\n\n    exactIntCubeRoot 800 == Nothing\n    exactIntCubeRoot 1000 == Just 10\n",
                "type": "Int -> Maybe Int"
            },
            {
                "name": "exactIntSquareRoot",
                "comment": " Integer square root returning `Nothing` if the given number is not a\nsquare.\n\n    exactIntSquareRoot 20 == Nothing\n    exactIntSquareRoot 25 == Just 5\n",
                "type": "Int -> Maybe Int"
            },
            {
                "name": "fromBase",
                "comment": " Interpret a list of digits as a number in the given base. The input is \nexpected to consist of integers `d` for which `0 <= d < base`.\n\n    fromBase 2 [1, 0, 1, 0, 1, 0] = 42\n",
                "type": "Int -> List Int -> Int"
            },
            {
                "name": "gcd",
                "comment": " Calculate the greatest common divisor of two integers. `gcd x 0` and\n`gcd 0 x` both return `x`. Negative arguments are made positive first.\n\n    gcd 56 80 == 8\n",
                "type": "Int -> Int -> Int"
            },
            {
                "name": "intCubeRoot",
                "comment": " Integer cube root, rounding down.\n\n    intCubeRoot 800 == 9\n    intCubeRoot 1000 == 10\n",
                "type": "Int -> Int"
            },
            {
                "name": "intSquareRoot",
                "comment": " Integer square root, rounding down.\n\n    intSquareRoot 20 == 4\n    intSquareRoot 25 == 5\n",
                "type": "Int -> Int"
            },
            {
                "name": "isCoprimeTo",
                "comment": " Test whether two integers are coprime.\n\n    56 `isCoprimeTo` 80 == False\n    5 `isCoprimeTo` 8 \n",
                "type": "Int -> Int -> Bool"
            },
            {
                "name": "isCube",
                "comment": " Test whether a number is a cube.\n\n    isCube 800 == False\n    isCube 1000 == True\n",
                "type": "Int -> Bool"
            },
            {
                "name": "isEven",
                "comment": " Test whether an integer is even.\n\n    isEven 2 == True\n    isEven 3 == False\n",
                "type": "Int -> Bool"
            },
            {
                "name": "isMultipleOf",
                "comment": " Test whether one number is a multiple of another.\n\n    120 `isMultipleOf` 10 == True\n    125 `isMultipleOf` 10 == False\n",
                "type": "Int -> Int -> Bool"
            },
            {
                "name": "isOdd",
                "comment": " Test whether an integer is odd.\n\n    isOdd 2 == False\n    isOdd 3 == True\n",
                "type": "Int -> Bool"
            },
            {
                "name": "isPrime",
                "comment": " Test whether an integer is a positive prime.\n\n    isPrime 2357 == True\n    isPrime 500 == False\n",
                "type": "Int -> Bool"
            },
            {
                "name": "isSquare",
                "comment": " Test whether a number is a square.\n\n    isSquare 20 == False\n    isSquare 25 == True\n",
                "type": "Int -> Bool"
            },
            {
                "name": "lcm",
                "comment": " Calculate the least common multiple of two integers. `lcm x 0` and\n`lcm 0 x` both return `0`. Negative arguments are made positive first.\n\n    lcm 56 80 == 560\n",
                "type": "Int -> Int -> Int"
            },
            {
                "name": "numDivisors",
                "comment": " Get the number of divisors of a number (counting itself).\n",
                "type": "Int -> Int"
            },
            {
                "name": "powerMod",
                "comment": " `powerMod b e m` efficiently calculates `b ^ e` (modulo `m`). It assumes\n`b >= 0`, `e >= 0` and `m >= 1`.\n\nFor example, to compute `4147 ^ 8671 % 1000` efficiently:\n\n    powerMod 4147 8671 1000 == 803\n",
                "type": "Int -> Int -> Int -> Int"
            },
            {
                "name": "primeExponents",
                "comment": " Return a list of all prime-exponent pairs for a given positive integer's\nprime decomposition, with the primes in ascending order. If the input is less\nthan 2, the empty list is returned.\n\n    primeExponents 24 == [(2, 3), (5, 2)]                -- 2^3 * 5^2\n    primeExponents 531764 == [(2, 1), (11, 2), (13, 3)]  -- 2^1 * 11^2 * 13^3\n    primeExponents 1 == []                               -- empty product\n",
                "type": "Int -> List ( Int, Int )"
            },
            {
                "name": "primeFactors",
                "comment": " Return a list of all prime factors for a given positive integer, in\nascending order. If the input is less than 2, the empty list is returned.\n\n    primeFactors 24 == [2, 2, 2, 3]\n    primeFactors 767 == [13, 59]\n    primeFactors 1 == []\n",
                "type": "Int -> List Int"
            },
            {
                "name": "primesBelow",
                "comment": " Get all primes in the given range `[0..n-1]`, using the Sieve of\nEratosthenes.\n\n    primesBelow 4 == [2, 3]\n    primesBelow 17 == [2, 3, 5, 7, 11, 13]\n",
                "type": "Int -> List Int"
            },
            {
                "name": "properDivisors",
                "comment": " Get all proper divisors (i.e., divisors less than the input) of a number,\nin ascending order.\n\n    properDivisors 20 == [1, 2, 4, 5, 10]\n",
                "type": "Int -> List Int"
            },
            {
                "name": "toBase",
                "comment": " Convert a number to a list of digits in the given base. The input number is\nmade positive first.\n\n    toBase 2 42 = [1, 0, 1, 0, 1, 0]  -- 42 in binary\n",
                "type": "Int -> Int -> List Int"
            },
            {
                "name": "totient",
                "comment": " Compute Euler's totient function `φ(n)`: the number of positive integers\n`1 <= k <= n` for which `gcd(n, k) == 1`. The input is made positive first.\n\n    totient 99 == 60\n    totient 1450 == 560\n",
                "type": "Int -> Int"
            }
        ],
        "binops": []
    }
]