.

Primitive NameUse RowPrimitive SemanticsStatus [2]ArityStrictnessType SignatureFront-End Mappings

.

YhcHugsGHC

.

Arithmetic Primitives

.

ADD_WYAdd two integer valuesM2AllInt -> Int -> IntADD_WPrelude;primPlusInt

.

ADD_LYAdd two long integer valuesADD_W2AllInteger -> Integer -> IntegerYHC.Primitive;PrimIntegerAddPrelude;primPlusInteger

.

SUB_WYSubtract two integer valuesM2AllInt -> Int -> IntSUB_WPrelude;primMinusInt

.

SUB_LYSubtract two long integer valuesSUB_W2AllInteger -> Integer -> IntegerYHC.Primitive;PrimIntegerSubPrelude;primMinusInteger

.

NEG_WYNegate an integer valueM1AllInt -> IntNEG_WPrelude;primNegInt

.

NEG_LYNegate a long integer valueNEG_W1AllInteger -> IntegerYHC.Primitive;PrimIntegerNegPrelude;primNegInteger

.

EQ_WYCompare two integer values for equalityM2AllInt -> Int -> BoolEQ_WPrelude;primEqInt

.

EQ_LYCompare two long integer values for equalityEQ_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerEqPrelude;primEqInteger

.

EQ_CYCompare two characters for equalityM2AllChar -> Char -> BoolPrelude;primEqChar

.

NE_WYCompare two integer values for non-equalityM2AllInt -> Int -> BoolNE_W

.

NE_LYCompare two long integer values for non-equalityNE_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerNe

.

LE_WYCompare two integer values for less or equalM2AllInt -> Int -> BoolLE_W

.

LE_LYCompare two long integer values for less or equalLE_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerLe

.

LT_WYCompare two integer values for lessM2AllInt -> Int -> BoolLT_W

.

LT_LYCompare two long integer values for lessLT_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerLt

.

GE_WYCompare two integer values for greater or equalM2AllInt -> Int -> BoolGE_W

.

GE_LYCompare two long integer values for greater or equalGE_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerGe

.

GT_WYCompare two integer values for greaterM2AllInt -> Int -> BoolGT_W

.

GT_LYCompare two long integer values for greaterGT_W2AllInteger -> Integer -> BoolYHC.Primitive;primIntegerGt

.

CMP_WYCompare two integer valuesM2AllInt -> Int -> OrderingPrelude;primCmpInt

.

CMP_LYCompare two long integer valuesCMP_W2AllInteger -> Integer -> OrderingPrelude;primCmpInteger

.

CMP_CYCompare two charactersM2AllChar -> Char -> OrderingPrelude;primCmpChar

.

MUL_WYMultiply two integer valuesM2AllInt -> Int -> IntMUL_WPrelude;primMulInt

.

MUL_LYMultiply two long integer valuesMUL_W2AllInteger -> Integer -> IntegerYHC.Primitive;PrimIntegerMulPrelude;primMulInteger

.

MOD_WYRemainder of flooring integer divisionM2AllInt -> Int -> Int

.

MOD_LYRemainder of flooring long integer divisionMOD_W2AllInteger -> Integer -> Integer

.

DIV_WYQuotient of flooring integer divisionM2AllInt -> Int -> Int

.

DIV_LYQuotient of flooring long integer divisionDIV_W2AllInteger -> Integer -> Integer

.

REM_WYRemainder of trunc to zero integer divisionM2AllInt -> Int -> Int

.

REM_LYRemainder of trunc to zero long integer divisionREM_W2AllInteger -> Integer -> Integer

.

QUOT_WYQuotient of trunc to zero integer divisionM2AllInt -> Int -> Int

.

QUOT_LYQuotient of trunc to zero long integer divisionQUOT_W2AllInteger -> Integer -> Integer

.

ADD_DYAdd two double precision valuesM2AllDouble -> Double -> DoubleADD_DPrelude;primPlusDouble

.

ADD_FYAdd two floating point single precision valuesADD_D2AllFloat -> Float -> FloatADD_FPrelude;primPlusFloat

.

ADD_DYSubtract two double precision valuesM2AllDouble -> Double -> DoubleSUB_DPrelude;primMinusDouble

.

SUB_FYSubtract two floating point single precision valuesADD_D2AllFloat -> Float -> FloatSUB_FPrelude;primMinusFloat

.

MUL_DYMultiply two double precision valuesM2AllDouble -> Double -> DoubleMUL_DPrelude;primMulDouble

.

MUL_FYMultiply two floating point single precision valuesADD_D2AllFloat -> Float -> FloatMUL_FPrelude;primMulFloat

.

DIV_DYDivide two double precision valuesM2AllDouble -> Double -> DoubleSLASH_DPrelude;primDivDouble

.

DIV_FYDivide two floating point single precision valuesADD_D2AllFloat -> Float -> FloatSLASH_FPrelude;primDivFloat

.

NEG_DYNegate a double precision valueM1AllFloat -> FloatNEG_DPrelude;primNegDouble

.

NEG_FYNegate a floating point single precision valueNEG_D1AllFloat -> FloatNEG_FPrelude;primNegFloat

.

ABS_WYAbsolute value of an integerM1AllInt -> IntYHC.Primitive;primIntAbs

.

ABS_LYAbsolute value of a long integerABS_W1AllInteger -> Integer

.

ABS_DYAbsolute value of a double precision M1AllDouble -> Double

.

ABS_FYAbsolute value of a floatingABS_D1AllFloat -> Float

.

SIGNUM_WYSign of an integerM1AllInt -> IntYHC.Primitive;primIntSignum

.

SIGNUM_LYSign of a long integerSIGNUM_W1AllInteger -> Integer

.

SIGNUM_DYSign of a doubleM1AllDouble -> Double

.

SIGNUM_FYSign of a floatSIGNUM_D1AllFloat -> Float

.

LE_DYCompare two double values for less or equalM2AllDouble -> Double -> BoolLE_D

.

LE_FYCompare two floating values for less or equalLE_D2AllFloat -> Float -> BoolLE_F

.

LT_DYCompare two double values for lessM2AllDouble -> Double -> BoolLT_D

.

LT_FYCompare two floating values for lessLT_D2AllFloat -> Float -> BoolLT_F

.

GE_DYCompare two double values for greater or equalM2AllDouble -> Double -> BoolGE_D

.

GE_FYCompare two floating values for greater or equalGE_D2AllFloat -> Float -> BoolGE_F

.

GT_DYCompare two double values for greaterM2AllDouble -> Double -> BoolGT_D

.

GT_FYCompare two floating values for greaterGT_D2AllFloat -> Float -> BoolGT_F

.

EQ_DYCompare two double values for equalityE [1]2AllDouble -> Double -> BoolEQ_D

.

EQ_FYCompare two floating values for equalityE2AllFloat -> Float -> BoolEQ_F

.

NE_DYCompare two double values for non-equalityE2AllDouble -> Double -> BoolEQ_D

.

NE_FYCompare two floating values for non-equalityE2AllFloat -> Float -> BoolEQ_F

.

CMP_DYCompare two double valuesM2AllDouble -> Double -> OrderingPrelude;primCmpDouble

.

CMP_FYCompare two floating valuesCMP_D2AllFloat -> Float -> OrderingPrelude;primCmpFloat

.

CAST_LWYCast long integer to integerM1AllInteger -> IntYHC.Primitive;primIntFromIntegerPrelude;primIntegerToInt

.

CAST_WLYCast integer to long integerM1AllInt -> IntegerYHC.Primitive;primIntegerFromIntPrelude;primIntToInteger

.

CAST_LDYCast long integer to doubleM1AllInteger -> DoubleYHC.Primitive;primDoubleFromIntegerPrelude;primIntegerToDouble

.

Character/Unicode Primitives

.

MAX_CYMaximal value of a characterM0NoneCharPrelude;primMaxChar

.

ISUPR_CYCharacter in Unicode categories: Lu | LtM1AllChar -> BoolPrelude;primIsUpper

.

ISLOW_CYCharacter in Unicode categories: LlM1AllChar -> BoolPrelude;primIsLower

.

ISALP_CYCharacter in Unicode categories: Lu | Ll | Lt | Lm | LoM1AllChar -> BoolPrelude;primIsAlpha

.

ISALN_CYCharacter in Unicode categories: Lu through NoM1AllChar -> BoolPrelude;primIsAlphaNum

.

ISPRT_CYCharacter in Unicode catrgories: Lu through ZsM1AllChar -> BoolPrelude;isPrint

.

TOUPR_CYChange character case to upperM1AllChar -> CharPrelude;toUpper

.

TOLOW_CYChange character case to lowerM1AllChar -> CharPrelude;toLower

.

TOTIT_CYChange character case to titleTOUPR_C1AllChar -> CharHugs.Char;toTitle

.

UCAT_CYCharacter Unicode categoryM1AllChar -> IntHugs.Char;primUniGenCat

.

Math/Floating point Primitives

.

SIN_FYSine of a floatM1AllFloat -> FloatPrelude;primSinFloat

.

COS_FYCosine of a floatM1AllFloat -> FloatPrelude;primCosFloat

.

TAN_FYTangent of a floatM1AllFloat -> FloatPrelude;primTanFloat

.

ASIN_FYArcsine of a floatM1AllFloat -> FloatPrelude;primAsinFloat

.

ACOS_FYArccos. of a floatM1AllFloat -> FloatPrelude;primAcosFloat

.

ATAN_FYArctan. of a floatM1AllFloat -> FloatPrelude;primAtanFloat

.

EXP_FYExponent of a floatM1AllFloat -> FloatPrelude;primExpFloat

.

LOG_FYNat. logarithm of a floatM1AllFloat -> FloatPrelude;primLogFloat

.

SQRT_FYSquare root of a floatM1AllFloat -> FloatPrelude;primSqrtFloat

.

SIN_DYSine of a doubleM1AllDouble -> DoublePrelude;primSinDouble

.

COS_DYCosine of a doubleM1AllDouble -> DoublePrelude;primCosDouble

.

TAN_DYTangent of a doubleM1AllDouble -> DoublePrelude;primTanDouble

.

ASIN_DYArcsine of a doubleM1AllDouble -> DoublePrelude;primAsinDouble

.

ACOS_DYArccos. of a doubleM1AllDouble -> DoublePrelude;primAcosDouble

.

ATAN_DYArctan. of a doubleM1AllDouble -> DoublePrelude;primAtanDouble

.

EXP_DYExponent of a doubleM1AllDouble -> DoublePrelude;primExpDouble

.

LOG_DYNat. logarithm of a doubleM1AllDouble -> DoublePrelude;primLogDouble

.

SQRT_DYSquare root of a doubleM1AllDouble -> DoublePrelude;primSqrtDouble

.

RADIX_FYConstant 2M0IntPrelude;primFloatRadix, Prelude;primDoubleRadix

.

DIGITS_FYSignificant digits in a floatM0IntPrelude;primFloatDigits

.

MINEXP_FYMinimal exponent of a floatM0IntPrelude;primFloatMinExp

.

MAXEXP_FYMaximal exponent of a floatM0IntPrelude;primFloatMaxExp

.

ENC_FYEncode a float from significand and exponentM2AllInteger -> Int -> FloatPrelude;primFloatEncode

.

DEC_FYDecode a float into significand and exponentM1AllFloat -> (Integer, Int)Prelude;primFloatDecode

.

DIGITS_DYSignificant digits in a doubleM0IntPrelude;primDoubleDigits

.

MINEXP_DYMinimal exponent of a doubleM0IntPrelude;primDoubleMinExp

.

MAXEXP_DYMaximal exponent of a doubleM0IntPrelude;primDoubleMaxExp

.

ENC_DYEncode a double from significand and exponentM2AllInteger -> Int -> DoublePrelude;primDoubleEncode

.

DEC_DYDecode a double into significand and exponentM1AllDouble -> (Integer, Int)Prelude;primDoubleDecode

.

Special purpose primitives

.

THROW_EYThrow an exceptionM1NoneException -> aPrelude;throw

.

Implementation-specific primitives

.

QRM_WYCombination of QUOT_W and REM_WM2AllInt -> Int -> (Int, Int)Prelude;primQrmInt

.

QRM_LYCombination of QUOT_L and REM_LQRM_W2AllInteger -> Integer -> (Integer, Integer)Prelude;primQrmInteger

.

STRICT_APPYStrict application: always forces its argumentM2FT(a -> b) -> a -> bPrelude;$!

.

SEL_ELEMYSelect an Nth element from a data structureM3FTTa -> b -> Int -> cPrelude._SEL

.

SHOWS_WYShow an Int valueO3AllInt -> a -> String -> StringPrelude;primShowsInt

.

SHOWS_LYShow and Integer valueSHOWS_W3AllInt -> a -> String -> StringPrelude;primShowsInteger
[1] really, how can we compare two arbitrarily precised floating values? --golubovsky Friday, June 20, 2008 4:14:08 PM
[2] Whether backends must/may implement/substitute this --golubovsky Friday, June 20, 2008 9:28:00 AM