How do I get maxBound of Int in Idris? I want to write my code such that it works both when the word size is 32-bit and 64-bit, and I think that will change the size of the Int.
Maximum Int in Idris
143 Views Asked by Janus Troelsen At
1
There are 1 best solutions below
Related Questions in BOUNDED-TYPES
- Why does Enum require to implement toEnum and fromEnum, if that's not enough for types larger than Int?
- Maximum Int in Idris
- Betareg for bounded variable
- Unable to add value to a java generic list
- Not able to create generic bounded class objects with interface
- How to create an object for generic class?
- Is it possible to have a Type Parameter that extends 2 other type parameters?
- Using an Interface as a super type for Enum classes - problem with accessing Enum-specific methods
- python equivalent to c# where T : new()
- Bounded type parameters: cannot access subtype methods when overriding
- Java Generics : Convert unbounded types to bounded types
- Bounded Types in generics
- Java generics-in-an-instance-field design
- How can I determine if one Enum value is the successor of another?
- Java interface hierarchy and it's methods with bounded type Generics
Related Questions in IDRIS2
- How to get normal values from fastPack in Idris?
- What does it mean to import a directory in Idris2?
- Type-safe linear maybeToList
- Idris: Cannot use functions as applicative functors?
- Type-safely Implementing an Arbitrary Degree Blackbird Combinator (B-n Combinator)
- Maximum Int in Idris
- What does the pound sign mean in Idris 2?
- What is the equivalent of mapM and mapM_ in idris2?
- How to generate a Decidable inequality proof in Idris2?
- How to write a pure function in idris2 FFI?
- Updating a dependently typed field without updating what it depends on
- How to use the result of a depedent pair?
- How to fix an inaccessible variable in idris2?
- What are the builddir and outputdir and why are they generating a "File Not Found" error?
- How does Fin "know" not to go past its type bound?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I don't believe there is such a function in Idris. I think I asked this question on the language forum a while back, and the answer was no, but I might be misremembering.
That said, you seem to be assuming that
Intandinthave the same width for every platform. I don't know if that's true, but if it were, you could write an FFI function to getINT_MAXfrom#include <limits.h>.Really though, I'd ask if you need to use a C
int(and IdrisInt) at all, and whether you can useint32_tandInt32, orint64_tandInt64.