Int package:base-prelude

A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using minBound and maxBound from the Bounded class.
16-bit signed integer type
32-bit signed integer type
64-bit signed integer type
8-bit signed integer type
A signed integral type that can be losslessly converted to and from Ptr. This type is also compatible with the C99 type intptr_t, and can be marshalled to and from that type safely.
Arbitrary precision integers. In contrast with fixed-size integral types such as Int, the Integer type represents the entire infinite range of integers. Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations. If the value is small (fit into an Int), IS constructor is used. Otherwise Integer and IN constructors are used to store a BigNat representing respectively the positive or the negative value magnitude. Invariant: Integer and IN are used iff value doesn't fit in IS
Integral numbers, supporting integer division. The Haskell Report defines no laws for Integral. However, Integral instances are customarily expected to define a Euclidean domain and have the following properties for the div/mod and quot/rem pairs, given suitable Euclidean functions f and g:
  • x = y * quot x y + rem x y with rem x y = fromInteger 0 or g (rem x y) < g y
  • x = y * div x y + mod x y with mod x y = fromInteger 0 or f (mod x y) < f y
An example of a suitable Euclidean function, for Integer's instance, is abs.
casts an IntPtr to a Ptr
Convert an Int in the range 0..15 to the corresponding single digit Char. This function fails on other inputs, and generates lower-case hexadecimal digits.
The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
intercalate xs xss is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.
>>> intercalate ", " ["Lorem", "ipsum", "dolor"]
"Lorem, ipsum, dolor"
Allow asynchronous exceptions to be raised even inside mask, making the operation interruptible (see the discussion of "Interruptible operations" in Exception). When called outside mask, or inside uninterruptibleMask, this function has no effect.
The intersect function takes the list intersection of two lists. For example,
>>> [1,2,3,4] `intersect` [2,4,6,8]
[2,4]
If the first list contains duplicates, so will the result.
>>> [1,2,2,3,4] `intersect` [6,4,4,2]
[2,2,4]
It is a special case of intersectBy, which allows the programmer to supply their own equality test. If the element is found in both the first and the second list, the element from the first list will be used.
The intersectBy function is the non-overloaded version of intersect.
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example,
>>> intersperse ',' "abcde"
"a,b,c,d,e"
the state during mask: asynchronous exceptions are masked, but blocking operations may still be interrupted
the state during uninterruptibleMask: asynchronous exceptions are masked, and blocking operations may not be interrupted
This exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console).
When invoked inside mask, this function allows a masked asynchronous exception to be raised, if one exists. It is equivalent to performing an interruptible operation (see #interruptible), but does not involve any actual blocking. When called outside mask, or inside uninterruptibleMask, this function has no effect.