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 -> Int64int64Sub
int64Sub : Int64 -> Int64 -> Int64int64Mul
int64Mul : Int64 -> Int64 -> Int64int64Div
int64Div : Int64 -> Int64 -> Int64int64Rem
int64Rem : Int64 -> Int64 -> Int64int64Lt
int64Lt : Int64 -> Int64 -> Boolint64Le
int64Le : Int64 -> Int64 -> Boolint64And
int64And : Int64 -> Int64 -> Int64int64Or
int64Or : Int64 -> Int64 -> Int64int64Xor
int64Xor : Int64 -> Int64 -> Int64int64Shl
int64Shl : Int64 -> Int64 -> Int64int64Shr
int64Shr : Int64 -> Int64 -> Int64int64Show
int64Show : Int64 -> Stringint64FromInt
int64FromInt : Int -> Int64int64ToInt
int64ToInt : Int64 -> IntminBound
minBound : Int64The least.
maxBound
maxBound : Int64The greatest.
add
add : Int64 -> Int64 -> Int64The sum, wrapped around: add maxBound 1 is minBound.
sub
sub : Int64 -> Int64 -> Int64mul
mul : Int64 -> Int64 -> Int64div
div : Int64 -> Int64 -> Int64Division 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 -> Int64The 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 -> Boollt
lt : Int64 -> Int64 -> Boolle
le : Int64 -> Int64 -> BoolfromInt
fromInt : Int -> Int64The Int64 an integer wraps around to: equal to it modulo 2^64.
toInt
toInt : Int64 -> IntinstanceEqualityInt64
instance instanceEqualityInt64 : Equality Int64instanceDebugInt64
instance instanceDebugInt64 : Debug Int64>>> debug (7 : Int64)"7"instanceShowInt64
instance instanceShowInt64 : Show Int64As debug writes it.
instanceOrderInt64
instance instanceOrderInt64 : Order Int64instanceAdditionInt64
instance instanceAdditionInt64 : Addition Int64instanceSubtractionInt64
instance instanceSubtractionInt64 : Subtraction Int64instanceMultiplicationInt64
instance instanceMultiplicationInt64 : Multiplication Int64instanceDivisionInt64
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 Int64The integer of the other sign, wrapped around: of minBound, itself.
instanceIsZeroInt64
instance instanceIsZeroInt64 : IsZero Int64instanceBitwiseInt64
instance instanceBitwiseInt64 : Bitwise Int64The 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"