hkt-toolbelt
Version:
Functional and composable type utilities
19 lines (18 loc) • 499 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.undigits = void 0;
const __1 = require("..");
/**
* Given a list of digits, return a natural number.
*
* @param {Digit.Digit[]} T - The list of digits.
*
* @example
* ```ts
* import { NaturalNumber } from "hkt-toolbelt";
*
* const T0 = NaturalNumber.undigits([1, 2, 3]); // 123
* const T1 = NaturalNumber.undigits([4, 5, 6]); // 456
* ```
*/
exports.undigits = ((x) => Number(__1.String.fromList(x)));