1// Generated by purs version 0.13.6
3var $foreign = require("./foreign.js");
4var Data_Boolean = require("../Data.Boolean/index.js");
5var Data_Bounded = require("../Data.Bounded/index.js");
6var Data_Maybe = require("../Data.Maybe/index.js");
7var Global = require("../Global/index.js");
8var $$Math = require("../Math/index.js");
9var Radix = function (x) {
13var fromStringAs = $foreign.fromStringAsImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
14var fromNumber = $foreign.fromNumberImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
15var unsafeClamp = function (x) {
16 if (x === Global.infinity) {
19 if (x === -Global.infinity) {
22 if (x >= $foreign.toNumber(Data_Bounded.top(Data_Bounded.boundedInt))) {
23 return Data_Bounded.top(Data_Bounded.boundedInt);
25 if (x <= $foreign.toNumber(Data_Bounded.bottom(Data_Bounded.boundedInt))) {
26 return Data_Bounded.bottom(Data_Bounded.boundedInt);
28 if (Data_Boolean.otherwise) {
29 return Data_Maybe.fromMaybe(0)(fromNumber(x));
31 throw new Error("Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): " + [ x.constructor.name ]);
33var round = function ($179) {
34 return unsafeClamp($$Math.round($179));
37 fromNumber: fromNumber,
39 hexadecimal: hexadecimal,
40 fromStringAs: fromStringAs,
41 toNumber: $foreign.toNumber,
42 toStringAs: $foreign.toStringAs
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list