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
140 Views Asked by Janus Troelsen At
1
There are 1 best solutions below
Related Questions in BOUNDED-TYPES
- Generic Wildcard Bounded Type vs Generic Bounded Type Parameter
- How to define bound type parameters in Java inner class
- Using bounded wildcard when class has bounded type parameters
- How to extend a bounded type in java
- Maximum Int in Idris
- Bounded Type Parameters in C++, any reason for the lack of it?
- Java Generics : Convert unbounded types to bounded types
- Using class level like generic bounded type parameters for method's formal arguments
- Is this method head correct? (Bounded type variables in Java)
- Using an Interface as a super type for Enum classes - problem with accessing Enum-specific methods
- Unable to add value to a java generic list
- Scala Bounds Intersection
- Bounded class as parameter
- How to compute the maximum of a floating point property of a Foldable via foldMap?
- Generics Bounded Type Parameter
Related Questions in IDRIS2
- What does the pound sign mean in Idris 2?
- Maximum Int in Idris
- Importing from the contrib library fails
- Returning a dependent pair from a foreign function
- Main.case block in case block in _ is not accessible in this context
- Idris2: Nested WITH clause
- Why idris2 can't proof that div 1 2 < 1 = True?
- How does Fin "know" not to go past its type bound?
- Why does Idris think my type parameter k is of type Type?
- Check length of a tuple by pattern matching
- How should I sum doubles in Idris?
- How do I read all of standard input in Idris2?
- How to use the result of a depedent pair?
- What are the builddir and outputdir and why are they generating a "File Not Found" error?
- Can I avoid lower-case global variables being shadowed in types?
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 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.