Skip to content
heff

int64

Int64: the integers from -9223372036854775808 to 9223372036854775807, wrapping around as the machine’s do (two’s complement): fromInt 9223372036854775808 is -9223372036854775808. A literal checked at Int64 is one ((7 : Int64)). Import it by a name, import int64 as Int64, as the other fixed-width types’ modules have the same names: Int64.fromInt, Int64.minBound. None of them is the prelude’s: its instances are the prelude’s operators and functions at Int64, wherever it is imported, by a name or not — x + 1, x / y, -x, x < y, max x y, and x y — so that, opened, it is in the way of none of them at another type. (Another fixed-width type’s value from one goes by way of an Int: toInt, then the other’s fromInt.)

int64Add

int64Add : Int64 -> Int64 -> Int64

int64Sub

int64Sub : Int64 -> Int64 -> Int64

int64Mul

int64Mul : Int64 -> Int64 -> Int64

int64Div

int64Div : Int64 -> Int64 -> Int64

int64Rem

int64Rem : Int64 -> Int64 -> Int64

int64Lt

int64Lt : Int64 -> Int64 -> Bool

int64Le

int64Le : Int64 -> Int64 -> Bool

int64And

int64And : Int64 -> Int64 -> Int64

int64Or

int64Or : Int64 -> Int64 -> Int64

int64Xor

int64Xor : Int64 -> Int64 -> Int64

int64Shl

int64Shl : Int64 -> Int64 -> Int64

int64Shr

int64Shr : Int64 -> Int64 -> Int64

int64Show

int64Show : Int64 -> String

int64FromInt

int64FromInt : Int -> Int64

int64ToInt

int64ToInt : Int64 -> Int

minBound

minBound : Int64

The least.

maxBound

maxBound : Int64

The greatest.

add

add : Int64 -> Int64 -> Int64

The sum, wrapped around: add maxBound 1 is minBound.

sub

sub : Int64 -> Int64 -> Int64

mul

mul : Int64 -> Int64 -> Int64

div

div : Int64 -> Int64 -> Int64

Division rounding toward zero (as C’s, not as an Int’s /); by 0, 0. By -1 it is a negation, wrapping around: of minBound, itself.

rem

rem : Int64 -> Int64 -> Int64

The remainder of div, of the sign of the dividend; by 0, the dividend, so that add (mul (div x y) y) (rem x y) is x whatever y is.

eq

eq : Int64 -> Int64 -> Bool

lt

lt : Int64 -> Int64 -> Bool

le

le : Int64 -> Int64 -> Bool

fromInt

fromInt : Int -> Int64

The Int64 an integer wraps around to: equal to it modulo 2^64.

toInt

toInt : Int64 -> Int

instanceEqualityInt64

instance instanceEqualityInt64 : Equality Int64

instanceDebugInt64

instance instanceDebugInt64 : Debug Int64
>>> debug (7 : Int64)
"7"

instanceShowInt64

instance instanceShowInt64 : Show Int64

As debug writes it.

instanceOrderInt64

instance instanceOrderInt64 : Order Int64

instanceAdditionInt64

instance instanceAdditionInt64 : Addition Int64

instanceSubtractionInt64

instance instanceSubtractionInt64 : Subtraction Int64

instanceMultiplicationInt64

instance instanceMultiplicationInt64 : Multiplication Int64

instanceDivisionInt64

instance instanceDivisionInt64 : Division Int64
>>> List.map debug ([7 / 2, -7 / 2, 7 / 0, minBound / -1] : List Int64)
Cons "3" (Cons "-3" (Cons "0" (Cons "-9223372036854775808" Nil)))

instanceRemainderInt64

instance instanceRemainderInt64 : Remainder Int64
>>> List.map debug ([7 % 2, -7 % 2, 7 % 0, minBound % -1, (7 / 0) * 0 + 7 % 0] : List Int64)
Cons "1" (Cons "-1" (Cons "7" (Cons "0" (Cons "7" Nil))))

instanceNegationInt64

instance instanceNegationInt64 : Negation Int64

The integer of the other sign, wrapped around: of minBound, itself.

instanceIsZeroInt64

instance instanceIsZeroInt64 : IsZero Int64

instanceBitwiseInt64

instance instanceBitwiseInt64 : Bitwise Int64

The bits, as two’s complement has them: shifted left by the second (modulo 64), the bits shifted out lost, and right, the sign copied in; by a negative second, the other way (shiftL x -n is shiftR x n).

>>> debug (and (shiftL 1 3 + 1) (complement 0) * 3 - 2 : Int64)
"25"