Module Prelude.PreludeBase

Copyright © 2011 - 2015, Ingo Wechsung

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This package provides basic definitions for the Frege language.

The Prelude packages are imported explicitly or implicitly during compilation of any other package. They define basic data structures, classes and functions.

The types and constructors for lists, unit type and tuple types are not defined here: They are provided programmatically by the compiler when it compiles a package with the name frege.prelude.PreludeBase. Nevertheless, they are considered part of the Prelude, thus qualified names like (,) are okay.

The packages are implementation specific insofar as the compiler may assume that certain items are defined here in a certain way. Changes may thus lead to compiler crashes or java code that will be rejected by the java compiler.

Imports

Table of Content

Definitions

data ()

Unit type

Constructors

()

Unit value

data (a, b)

2-tuple

Constructors

(,) a   b

2-tuple constructor

data (a, b, c)

3-tuple

Constructors

(,,) a   b   c

3-tuple constructor

data (a, b, c, d)

4-tuple

Constructors

(,,,) a   b   c   d

4-tuple constructor

data (a, b, c, d, e)

5-tuple

Constructors

(,,,,) a   b   c   d   e

5-tuple constructor

data (a, b, c, d, e, f)

6-tuple

Constructors

(,,,,,) a   b   c   d   e   f

6-tuple constructor

data (a, b, c, d, e, f, g)

7-tuple

Constructors

(,,,,,,) a   b   c   d   e   f   g

7-tuple constructor

data (a, b, c, d, e, f, g, h)

8-tuple

Constructors

(,,,,,,,) a   b   c   d   e   f   g   h

8-tuple constructor

data (a, b, c, d, e, f, g, h, i)

9-tuple

Constructors

(,,,,,,,,) a   b   c   d   e   f   g   h   i

9-tuple constructor

data (a, b, c, d, e, f, g, h, i, j)

10-tuple

Constructors

(,,,,,,,,,) a   b   c   d   e   f   g   h   i   j

10-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k)

11-tuple

Constructors

(,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k

11-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l)

12-tuple

Constructors

(,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l

12-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m)

13-tuple

Constructors

(,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m

13-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

14-tuple

Constructors

(,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n

14-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

15-tuple

Constructors

(,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o

15-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)

16-tuple

Constructors

(,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p

16-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)

17-tuple

Constructors

(,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q

17-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)

18-tuple

Constructors

(,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r

18-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)

19-tuple

Constructors

(,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s

19-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)

20-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t

20-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)

21-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u

21-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)

22-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v

22-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)

23-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w

23-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)

24-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x

24-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)

25-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y

25-tuple constructor

data (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

26-tuple

Constructors

(,,,,,,,,,,,,,,,,,,,,,,,,,) a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z

26-tuple constructor

data a→b

function

data [a]

list type

Constructors

: a   [a]
infixr  4

list construction

[]

empty list

class Eq e

The type class Eq provides operators Eq.==, Eq.!= and Eq.hashCode.

All types whose values can be compared for equality should be instances of this class. For algebraic data types instances can be automatically derived if all components are themselves instances of Eq.

Known Instances

Integer, Long, Char, Bool, (), Float, Double, Int, [], StringJ

Member Functions

!= ∷ Eq e ⇒ e → e → Bool
infix  7

Check for inequality. The default implementation obeys the laws

 !(a != a)
 (a != b) == !(a == b)
 (a == b) != (a != b)

These laws shall also be obeyed in all implementations.

== ∷ Eq e ⇒ e → e → Bool
infix  7

Check for equality. This function is required in all instances.

The basic law of philosophy

 a == a

shall be obeyed by all implementations.

hashCode ∷ Eq e ⇒ e → Int

Compute a hash code.

The following rules shall hold in all instances:

 a == b ==> hashCode a == hashCode b
 hashCode a != hashCode b ==> a != b

In addition, unequal values should produce unequal hash codes more likely than not.

The hash code in derived instances for algebraic data types is computed as follows:

 hashCode v = case v of
    Con_1 f_1 ... f_k -> fold mkhash 1 [1, hashCode f_1, ..., hashCode f_k ]
    ...
    Con_n f_1 ... f_k -> fold mkhash 1 [n, hashCode f_1, ..., hashCode f_k ]
   where mkhash a b = (31 * a) + b

Here, the Con_i with i>0 are the constructors, and in each clause the f_j with j >= 0 are bound to the fields of the constructor under consideration.

constructor ∷ a → Int
pure native frege.run.RunTM.constructor

Determines the constructor of a value. This is used like

constructor arg

where arg is any frege value.

Returns 0 for function types, product types and native types or the constructor number for constructed types. The constructor number is a small integer associated with every constructed value. It indicates the data constructor a value was constructed with.

The compiler assigns constructor numbers starting from 0 to the constructors defined in a data definition in the order of their appearance.

Examples

constructor [] == 0
constructor (a:as) == 1
constructor "string"  == 0    // native value

This function is strict in its argument, i.e.

constructor undefined == undefined

Implementation specific: This function is used in derived instances of Eq and Ord.

data Bool = pure native boolean

Bool values are based on Java's primitive boolean values. Note that true and false are literals, not constructors.

data HaskellBool

For compatibility with Haskell, the HaskellBool type defines constructors HaskellBool.True and HaskellBool.False.

When the identifiers True or False are used in patterns or expressions, qualified or unqualified, and name resolution detects that they resolve to HaskellBool.True or HaskellBool.False they will be replaced by literals true or false.

This is, of course, a hack, but I see no other way to bridge the gap between redefinable constructor ids and literals. For example, we couldn't simply define True as another literal keyword, because some Haskell code might use Prelude.True or could have code like.

 import Prelude hiding(True, False)
 data TriBool = False | Perhaps | True

Constructors

False

will be replaced by literal false

True

will be replaced by literal true

otherwise ∷ Bool

This is a constant with the value true. It is most often used as the last alternative in pattern guards:

 foo n | n >= 0    = ...
       | otherwise = ...
lazyif ∷ Bool → 𝖆 → 𝖆 → 𝖆

warning: will soon be replaced with bool This is used by code generation when a conditional expression appears in a lazy context, i.e.

 (42, if foo then bar else baz)

lazyif a b c evaluates to b if a is true, otherwise to c.

bool ∷ 𝖆 → 𝖆 → Bool → 𝖆

This is used by code generation when a conditional expression appears in a lazy context, i.e.

 (42, if foo then bar else baz)

bool a b c evaluates to a if c is true, otherwise to b.

data Int = pure native int

Int values are based on Java's primitive int values.

The existence of this type is assumed in numerous places in the compiler.

Like with all native Java types, be they primitive or reference types, Frege holds the raw int in boxed form. However, in certain cases the compiler will optimize the boxing away:

 sum a b c = a + b + c

can compute the sum of 3 Ints, Longs, Doubles or any other values of a type that is an instance of type class Num, but it may be somewhat slower than functions specialized for a given type.

According to the Java Language Specification, int values are 32 bit wide signed two's complement integers (§4.2). Java operations on int do not indicate overflow or underflow in any way (§4.2.2). Instead, just the low 32 bits of every result are retained.

Member Functions

.&. ∷ Int → Int → Int
pure native &
infixl  11

Computes binary /and/ of two integers. Uses the java &-operator.

.^. ∷ Int → Int → Int
pure native ^
infixl  10

Computes binary /exclusive or/ of two integers. Uses the java ^-operator.

.|. ∷ Int → Int → Int
pure native |
infixl  10

Computes binary /or/ of two integers. Uses the java |-operator.

char ∷ Int → Char
pure native (char)

i.char returns the Char value whose ordinal number is i

Result is only valid for integers in the range 0..65535

complement ∷ Int → Int
pure native ~
double ∷ Int → Double
pure native java.lang.Double.valueOf

convert an Int to a Double, i.e. 2.double == 2.0.

float ∷ Int → Float
pure native java.lang.Float.valueOf

convert an Int to a Float, i.e. 2.float == 2.0f.

For large integers, the result may have been be rounded.

long ∷ Int → Long
pure native java.lang.Long.valueOf

Convert an Int to a Long, i.e. 2.long == 2L.

rotateL ∷ Int → Int → Int
pure native java.lang.Integer.rotateLeft
infixl  12

Returns the value obtained by rotating the two's complement binary representation of the specified int value left

by the specified number of bits.

rotateR ∷ Int → Int → Int
pure native java.lang.Integer.rotateRight
infixl  12

Returns the value obtained by rotating the two's complement binary representation of the specified int value

right by the specified number of bits.

shiftL ∷ Int → Int → Int
pure native <<
infixl  12
shiftR ∷ Int → Int → Int
pure native >>
infixl  12
size ∷ Int
pure native java.lang.Integer.SIZE

The number of bits used to represent an int value in two's complement binary form

toHexString ∷ Int → String
pure native java.lang.Integer.toHexString

convert to a hexadecimal string

ushiftR ∷ Int → Int → Int
pure native >>>
infixl  12

unsigned right shift

data Integer = pure native java.math.BigInteger

Integer is a type for integer numbers of unlimited size, It has instances for Eq, Ord, Show and Integral.

This is derived from java.math.BigInteger.

Member Functions

.&. ∷ Integer → Integer → Integer
pure native and
infixl  11
.^. ∷ Integer → Integer → Integer
pure native xor
infixl  10
.|. ∷ Integer → Integer → Integer
pure native or
infixl  10
bitLength ∷ Integer → Int
pure native bitLength

Returns the number of bits in the minimal two's-complement representation of this Integer, excluding a sign bit.

compareTo ∷ Integer → Integer → Int
pure native compareTo
complement ∷ Integer → Integer
pure native not
double ∷ Integer → Double
pure native doubleValue
int ∷ Integer → Int
pure native intValue
long ∷ Integer → Long
pure native longValue
nMod ∷ Integer → Integer → Integer
pure native mod

Warning! Throws ArithmeticException when divisor is negative.

shiftL ∷ Integer → Int → Integer
pure native shiftLeft
infixl  12
shiftR ∷ Integer → Int → Integer
pure native shiftRight
infixl  12
ten ∷ Integer
pure native java.math.BigInteger.TEN
toString ∷ Integer → String
pure native toString
ushiftR ∷ Integer → Int → Integer
infixl  12

unsigned right shift on big integers does not really make sense ...

valueOf ∷ Long → Integer
pure native java.math.BigInteger.valueOf

construction from a Long, see also StringJ.aton and StringJ.integer

data Long = pure native long

Long values are based on Java's primitive long values.

According to the Java Language Specification, long values are 64 bit wide signed two's complement integers (§4.2). Java operations on long do not indicate overflow or underflow in any way (§4.2.2). Instead, just the low 64 bits of every result are retained.

Member Functions

.&. ∷ Long → Long → Long
pure native &
infixl  11

Computes binary and of two integers. Uses the java &-operator.

.^. ∷ Long → Long → Long
pure native ^
infixl  10

Computes binary exclusive or of two long integers. Uses the java ^-operator.

.|. ∷ Long → Long → Long
pure native |
infixl  10

Computes binary or of two long integers. Uses the java |-operator.

complement ∷ Long → Long
pure native ~
double ∷ Long → Double
pure native java.lang.Double.valueOf

Convert an Long to a Double, i.e. 42L.double == 42.0.

For large numbers, the result may have been be rounded.

float ∷ Long → Float
pure native java.lang.Float.valueOf

Convert an Long to a Float, i.e. 42L.float == 42.0f.

For large numbers, the result may have been be rounded.

int ∷ Long → Int
pure native (int)

Uses a java cast to convert a Long to an Int. This is a narrowing primitive conversion in java parlance.

rotateL ∷ Long → Int → Long
pure native java.lang.Long.rotateLeft
infixl  12

Returns the value obtained by rotating the two's complement binary representation

of the specified long value left by the specified number of bits.

rotateR ∷ Long → Int → Long
pure native java.lang.Long.rotateRight
infixl  12

Returns the value obtained by rotating the two's complement binary representation

of the specified long value right by the specified number of bits.

shiftL ∷ Long → Int → Long
pure native <<
infixl  12
shiftR ∷ Long → Int → Long
pure native >>
infixl  12
size ∷ Int
pure native java.lang.Long.SIZE
ushiftR ∷ Long → Int → Long
pure native >>>
infixl  12

unsigned right shift

data Char = pure native char

Char values are based on Java's primitive char values.

This type has many native functions based on the methods in java.lang.Character.

Most is... functions work on Char and Int (codepoint).

Likewise, most to...Case functions work on codepoints.

Member Functions

digit ∷ Char → Int → Int
pure native java.lang.Character.digit

Returns the numeric value of the character argument in the specified radix.

If the character is not a digit in the given radix, -1 is returned.

The radix must be in the range 2..36, otherwise also -1 is returned.

forDigit ∷ Int → Int → Char
pure native java.lang.Character.forDigit
 Char.forDigit d r

returns the character for the digit d in radix r

d must not be negative and lower than r, and r must be in the range 2..36

When the arguments are invalid the character '\u0000' is returned.

getName ∷ Char → Maybe String
         | Int → Maybe String
pure native java.lang.Character.getName

Return the Unicode name of the code point or null if it is unassigned.

getName𝖆 ∷ Char → Maybe String
pure native java.lang.Character.getName  overloads getName

Return the Unicode name of the code point or null if it is unassigned.

getName𝖇 ∷ Int → Maybe String
pure native java.lang.Character.getName  overloads getName

Return the Unicode name of the code point or null if it is unassigned.

getType ∷ Char → Int
         | Int → Int
pure native java.lang.Character.getType

Returns a value indicating a character's general category.

getType𝖆 ∷ Char → Int
pure native java.lang.Character.getType  overloads getType

Returns a value indicating a character's general category.

getType𝖇 ∷ Int → Int
pure native java.lang.Character.getType  overloads getType

Returns a value indicating a character's general category.

highSurrogate ∷ Int → Char
pure native java.lang.Character.highSurrogate

The leading surrogate (which is a high surrogate code unit) of the surrogate pair representing the specified supplementary character (Unicode code point) in the UTF-16 encoding.

If the specified value is not a supplementary character, an unspecified character is returned.

See also: Char.isSupplementaryCodePoint, Char.lowSurrogate, Char.toCodePoint

The following holds:

 isSupplementaryCodePoint x ==> (x == toCodePoint (highSurrogate x) (lowSurrogate x))
isDefined ∷ Char → Bool
           | Int → Bool
pure native java.lang.Character.isDefined

Determines if a character (Unicode code point) is defined in Unicode.

A character is defined if at least one of the following is true:

  • It has an entry in the UnicodeData file.
  • It has a value in a range defined by the UnicodeData file.
isDefined𝖆 ∷ Char → Bool
pure native java.lang.Character.isDefined  overloads isDefined

Determines if a character (Unicode code point) is defined in Unicode.

A character is defined if at least one of the following is true:

  • It has an entry in the UnicodeData file.
  • It has a value in a range defined by the UnicodeData file.
isDefined𝖇 ∷ Int → Bool
pure native java.lang.Character.isDefined  overloads isDefined

Determines if a character (Unicode code point) is defined in Unicode.

A character is defined if at least one of the following is true:

  • It has an entry in the UnicodeData file.
  • It has a value in a range defined by the UnicodeData file.
isDigit ∷ Char → Bool
         | Int → Bool
pure native java.lang.Character.isDigit
isDigit𝖆 ∷ Char → Bool
pure native java.lang.Character.isDigit  overloads isDigit
isDigit𝖇 ∷ Int → Bool
pure native java.lang.Character.isDigit  overloads isDigit
isHighSurrogate ∷ Char → Bool
pure native java.lang.Character.isHighSurrogate

Determines if the given char value is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).

Such values do not represent characters by themselves, but are used in the representation of supplementary characters in the UTF-16 encoding.

isISOControl ∷ Char → Bool
              | Int → Bool
pure native java.lang.Character.isISOControl

Determines if the specified character is an ISO control character. A character is considered to be an ISO control character if its code is in the range "\u0000" through "\u001F" or in the range "\u007F" through "\u009F".

isISOControl𝖆 ∷ Char → Bool
pure native java.lang.Character.isISOControl  overloads isISOControl

Determines if the specified character is an ISO control character. A character is considered to be an ISO control character if its code is in the range "\u0000" through "\u001F" or in the range "\u007F" through "\u009F".

isISOControl𝖇 ∷ Int → Bool
pure native java.lang.Character.isISOControl  overloads isISOControl

Determines if the specified character is an ISO control character. A character is considered to be an ISO control character if its code is in the range "\u0000" through "\u001F" or in the range "\u007F" through "\u009F".

isLetter ∷ Char → Bool
          | Int → Bool
pure native java.lang.Character.isLetter
isLetterOrDigit ∷ Char → Bool
                 | Int → Bool
pure native java.lang.Character.isLetterOrDigit
isLetterOrDigit𝖆 ∷ Char → Bool
pure native java.lang.Character.isLetterOrDigit  overloads isLetterOrDigit
isLetterOrDigit𝖇 ∷ Int → Bool
pure native java.lang.Character.isLetterOrDigit  overloads isLetterOrDigit
isLetter𝖆 ∷ Char → Bool
pure native java.lang.Character.isLetter  overloads isLetter
isLetter𝖇 ∷ Int → Bool
pure native java.lang.Character.isLetter  overloads isLetter
isLowSurrogate ∷ Char → Bool
pure native java.lang.Character.isLowSurrogate

Determines if the given char value is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).

Such values do not represent characters by themselves, but are used in the representation of supplementary characters in the UTF-16 encoding.

isLowerCase ∷ Char → Bool
             | Int → Bool
pure native java.lang.Character.isLowerCase
isLowerCase𝖆 ∷ Char → Bool
pure native java.lang.Character.isLowerCase  overloads isLowerCase
isLowerCase𝖇 ∷ Int → Bool
pure native java.lang.Character.isLowerCase  overloads isLowerCase
isSupplementaryCodePoint ∷ Int → Bool
pure native java.lang.Character.isSupplementaryCodePoint

Determines whether the specified character (Unicode code point) is in the supplementary character range.

This is roughly equivalent to

 (> ord Char.maxBound)

except that it also checks if the value is lower than 0x110000

If, for some integer n

 not (Char.isSupplementaryCodePoint n) && (n > ord Char.maxBound)

then n is not a codepoint at all.

isSurrogate ∷ Char → Bool
pure native java.lang.Character.isSurrogate

Determines if the given char value is a Unicode surrogate code unit.

Such values do not represent characters by themselves, but are used in the representation of supplementary characters in the UTF-16 encoding.

A char value is a surrogate code unit if and only if it is either a low-surrogate code unit or a high-surrogate code unit.

isSurrogatePair ∷ Char → Char → Bool
pure native java.lang.Character.isSurrogatePair

Determines whether the specified pair of char values is a valid Unicode surrogate pair.

isUpperCase ∷ Char → Bool
             | Int → Bool
pure native java.lang.Character.isUpperCase
isUpperCase𝖆 ∷ Char → Bool
pure native java.lang.Character.isUpperCase  overloads isUpperCase
isUpperCase𝖇 ∷ Int → Bool
pure native java.lang.Character.isUpperCase  overloads isUpperCase
isValidCodePoint ∷ Int → Bool
pure native java.lang.Character.isValidCodePoint

Determines whether the specified code point is a valid Unicode code point value.

This is the case if it is not negative and lower than 0x110000

isWhitespace ∷ Char → Bool
              | Int → Bool
pure native java.lang.Character.isWhitespace
isWhitespace𝖆 ∷ Char → Bool
pure native java.lang.Character.isWhitespace  overloads isWhitespace
isWhitespace𝖇 ∷ Int → Bool
pure native java.lang.Character.isWhitespace  overloads isWhitespace
lowSurrogate ∷ Int → Char
pure native java.lang.Character.lowSurrogate

The trailing surrogate (which is a low surrogate code unit) of the surrogate pair representing the specified supplementary character (Unicode code point) in the UTF-16 encoding.

If the specified value is not a supplementary character, an unspecified character is returned.

See also: Char.isSupplementaryCodePoint, Char.highSurrogate, Char.toCodePoint

The following holds:

 isSupplementaryCodePoint x ==> (x == toCodePoint (highSurrogate x) (lowSurrogate x))
toCodePoint ∷ Char → Char → Int
pure native java.lang.Character.toCodePoint
 Char.toCodePoint high low

Converts the specified surrogate pair to its supplementary code point value. This function does not validate the specified surrogate pair. The caller must validate it using Char.isSurrogatePair if necessary.

toLowerCase ∷ Char → Char
             | Int → Int
pure native java.lang.Character.toLowerCase

The lowercase equivalent of the character, if any; otherwise, the character itself.

toLowerCase𝖆 ∷ Char → Char
pure native java.lang.Character.toLowerCase  overloads toLowerCase

The lowercase equivalent of the character, if any; otherwise, the character itself.

toLowerCase𝖇 ∷ Int → Int
pure native java.lang.Character.toLowerCase  overloads toLowerCase

The lowercase equivalent of the character, if any; otherwise, the character itself.

toTitleCase ∷ Char → Char
             | Int → Int
pure native java.lang.Character.toTitleCase

The titlecase equivalent of the character, if any; otherwise, the character itself.

toTitleCase𝖆 ∷ Char → Char
pure native java.lang.Character.toTitleCase  overloads toTitleCase

The titlecase equivalent of the character, if any; otherwise, the character itself.

toTitleCase𝖇 ∷ Int → Int
pure native java.lang.Character.toTitleCase  overloads toTitleCase

The titlecase equivalent of the character, if any; otherwise, the character itself.

toUpperCase ∷ Char → Char
             | Int → Int
pure native java.lang.Character.toUpperCase

The uppercase equivalent of the character, if any; otherwise, the character itself.

toUpperCase𝖆 ∷ Char → Char
pure native java.lang.Character.toUpperCase  overloads toUpperCase

The uppercase equivalent of the character, if any; otherwise, the character itself.

toUpperCase𝖇 ∷ Int → Int
pure native java.lang.Character.toUpperCase  overloads toUpperCase

The uppercase equivalent of the character, if any; otherwise, the character itself.

type String = StringJ Char

String values are based on Java's java.lang.String objects. String is an alias for StringJ Char

data StringJ a = pure native java.lang.String

For technical reasons, the native string type is defined with a phantom type, which allows us to treat strings like character lists.

The following rules apply:

Member Functions

++ ∷ StringJ a → StringJ a → StringJ a
pure native +
infixr  13

Concatenate two strings, uses Java's + operator

atod ∷ String → Double
pure native java.lang.Double.parseDouble

Like StringJ.double, but the exception is not checked, thus only good when one knows for sure that the parse will succeed.

atof ∷ String → Float
pure native java.lang.Float.parseFloat

Like StringJ.float, but the exception is not checked, thus only good when one knows for sure that the parse will succeed.

atoi ∷ String → Int
pure native java.lang.Integer.parseInt

Like StringJ.int, but the exception is not checked, thus only good when one knows for sure that the parse will succeed.

atol ∷ String → Long
pure native java.lang.Long.parseLong

Like StringJ.long, but the exception is not checked, thus only good when one knows for sure that the parse will succeed.

aton ∷ String → Integer
pure native new

Like StringJ.integer, but the exception is not checked, thus only good when one knows for sure that the parse will succeed.

charAt ∷ String → Int → Char
pure native charAt

retrieve character at index

codePointAt ∷ String → Int → Int
pure native codePointAt
codePointBefore ∷ String → Int → Int
pure native codePointBefore
codePointCount ∷ String → Int → Int → Int
pure native codePointCount
compareTo ∷ String → String → Int
pure native compareTo

StringJ.compareTo is used in the Ord instance of String

compareToIgnoreCase ∷ String → String → Int
pure native compareToIgnoreCase
concatenate ∷ String → String → String
pure native concat

This is the native String.concat, just renamed because naming conflicts

contains ∷ String → String → Bool
pure native contains
contentEquals ∷ String → String → Bool
pure native contentEquals
double ∷ String → (NumberFormatException | Double)
pure native java.lang.Double.parseDouble

Safe way to parse a Double value from a string. See StringJ.int

float ∷ String → (NumberFormatException | Float)
pure native java.lang.Float.parseFloat

Safe way to parse a Float value from a string. See StringJ.int

format ∷ String → a → String
        | String → a → b → String
        | String → a → b → c → String
        | String → a → b → c → d → String
        | String → a → b → c → d → e → String
        | String → a → b → c → d → e → f → String
        | String → a → b → c → d → e → f → g → String
        | String → a → b → c → d → e → f → g → h → String
        | String → a → b → c → d → e → f → g → h → i → String
pure native java.lang.String.format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖆 ∷ String → a → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖇 ∷ String → a → b → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖈 ∷ String → a → b → c → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖉 ∷ String → a → b → c → d → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖊 ∷ String → a → b → c → d → e → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖋 ∷ String → a → b → c → d → e → f → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖌 ∷ String → a → b → c → d → e → f → g → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖍 ∷ String → a → b → c → d → e → f → g → h → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

format𝖎 ∷ String → a → b → c → d → e → f → g → h → i → String
pure native java.lang.String.format  overloads format

Format 1 to 9 values

May throw IllegalFormatException, if the type of any argument does not fit the format specifier.

indexOf ∷ String → Char → Int
         | String → Char → Int → Int
         | String → String → Int
         | String → String → Int → Int
pure native indexOf
 str.indexOf ch

the first index of ch in str, or -1 if not present

indexOf𝖆 ∷ String → Char → Int
pure native indexOf  overloads indexOf
 str.indexOf ch

the first index of ch in str, or -1 if not present

indexOf𝖇 ∷ String → Char → Int → Int
pure native indexOf  overloads indexOf
 str.indexOf ch

the first index of ch in str, or -1 if not present

indexOf𝖈 ∷ String → String → Int
pure native indexOf  overloads indexOf
 str.indexOf ch

the first index of ch in str, or -1 if not present

indexOf𝖉 ∷ String → String → Int → Int
pure native indexOf  overloads indexOf
 str.indexOf ch

the first index of ch in str, or -1 if not present

int ∷ String → (NumberFormatException | Int)
pure native java.lang.Integer.parseInt

Safe way to parse an integer from a string. java.lang.NumberFormatException will be caught and returned as Either.Left value. When the parse succeeds, the integer is returned in the Either.Right value.

Use like this:

 case s.int of
   Left exc -> ...     -- s is not well formed
   Right i  -> ...     -- the parsed value is in i
intToString ∷ Int → String
pure native java.lang.String.valueOf

convert an Int to a String

integer ∷ String → (NumberFormatException | Integer)
pure native new

Safe way to parse a big Integer value from a string. See StringJ.int

isEmpty ∷ String → Bool
pure native isEmpty
lastIndexOf ∷ String → Char → Int
             | String → Char → Int → Int
             | String → String → Int
             | String → String → Int → Int
pure native lastIndexOf
lastIndexOf𝖆 ∷ String → Char → Int
pure native lastIndexOf  overloads lastIndexOf
lastIndexOf𝖇 ∷ String → Char → Int → Int
pure native lastIndexOf  overloads lastIndexOf
lastIndexOf𝖈 ∷ String → String → Int
pure native lastIndexOf  overloads lastIndexOf
lastIndexOf𝖉 ∷ String → String → Int → Int
pure native lastIndexOf  overloads lastIndexOf
length ∷ StringJ a → Int
pure native length

The length of a String

long ∷ String → (NumberFormatException | Long)
pure native java.lang.Long.parseLong

Safe way to parse a long integer from a string. See StringJ.int

notify ∷ String → IO ()
native frege.run.Concurrent.notifyOne

notify a single thread waiting on the objects monitor

notifyAll ∷ String → IO ()
native frege.run.Concurrent.notifyAll

notify all threads waiting on the objects monitor

polymorphicElemAt ∷ StringJ a → Int → a
pure native PreludeBase.polyCharAt

Retrieve element of String at index

Because it is impossible to create a String from anything but Chars, the type is not even wrong.

Will be needed in the String instance of ListLike that expects a type with kind ->.

quote ∷ String → String
pure native java.util.regex.Pattern.quote

quote regular expression metacharacters in string

quoteReplacement ∷ String → String
pure native java.util.regex.Matcher.quoteReplacement

quote replacement string metacharacters in string

replace ∷ String → Char → Char → String
pure native replace

replace a character in a string

startsWith ∷ String → String → Bool
pure native startsWith

true if the second string is a prefix of the first one

substr ∷ StringJ a → Int → Int → StringJ a
pure native substring

see substr

toLowerCase ∷ String → String
pure native toLowerCase

convert to lower case

toUpperCase ∷ String → String
pure native toUpperCase

convert to upper case

trim ∷ String → String
pure native trim
wait ∷ String → IO ()
native frege.run.Concurrent.waitFor  throws InterruptedException

wait on Objects monitor

substr ∷ StringJ a → Int → Int → StringJ a
pure native substring

substr s start end returns the sub string of s that starts with the character at position start and extends to the character at position end-1.

This uses the native method substring of class java.lang.String. It will throw an IndexOutOfBoundsException if start is negative or larger than end or if end is greater than the length of s.

strtail ∷ StringJ a → Int → StringJ a
pure native substring

strtail s n returns a new string that is a substring of string s. The substring begins with the character at the specified index and extends to the end of s.

This uses the native method substring of class java.lang.String. It will throw an IndexOutOfBoundsException if n is negative or larger than the length of s.

atoi ∷ String → Int
data Float = pure native float

Float values are based on Java's primitive float values.

According to the Java Language Specification §4.2.3, float values are 32-bit-precision binary floating point values. The values and the operations on it behave as specified in the IEEE Standard for Binary Floating-Point Arithmetic.

Member Functions

double ∷ Float → Double
pure native (double)

Applies the java widening primitive conversion from float to double.

int ∷ Float → Int
pure native java.lang.Math.round

Returns the closest Int value to the argument. The result is rounded to an integer by adding 1/2, taking the floor of the result, and casting the result to type int.

The following property holds:

 (f < Int.maxBound.float && f > Int.minBound.float) ==>
   (f.int.float == (f + 0.5f).floor)

Special cases:

data Double = pure native double

Double values are Java's primitive double values.

According to the Java Language Specification §4.2.3, double values are 64-bit-precision binary floating point values. The values and the operations on it behave as specified in the IEEE Standard for Binary Floating-Point Arithmetic.

Member Functions

float ∷ Double → Float
pure native (float)

Applies the java narrowing primitive conversion from double to float

long ∷ Double → Long
pure native java.lang.Math.round

Returns the closest Long value to the argument. The result is rounded to an integer by adding 1/2, taking the floor of the result, and casting the result to type long.

The following property holds:

 (d < Long.maxBound.double && d > Long.minBound.double) ==>
   (d.long.double == (d + 0.5d).floor)

Special cases:

longBits ∷ Double → Long
pure native java.lang.Double.doubleToLongBits

bit representation of a double

data Object = pure native java.lang.Object

The Java Object type

Member Functions

getClass ∷ a → Class a
pure native frege.runtime.Runtime.getClass

for any value, we can get its Java class

notify ∷ Object → IO ()
native frege.run.Concurrent.notifyOne

notify a single thread waiting on the objects monitor

notifyAll ∷ Object → IO ()
native frege.run.Concurrent.notifyAll

notify all threads waiting on the objects monitor

wait ∷ Object → IO ()
native frege.run.Concurrent.waitFor  throws InterruptedException

wait on Objects monitor

data InterruptedException = pure native java.lang.InterruptedException
type CatchAll = Either Throwable

warning: probably catches more exceptions than you want to handle, use (Exception1|Exception2|Result) This is the principal return type for java methods that are expected to throw exceptions.

It is strongly recommended to use more specific exception types.

data Class a = pure native java.lang.Class

We need to do some reflection from frege code. For example, when we catch a Throwable thrown from Java code. we might want to know what it is.

Member Functions

forName ∷ String → IO (ClassNotFoundException | Class a)
native java.lang.Class.forName
getName ∷ Class a → String
pure native getName
data Throwable = pure native java.lang.Throwable

Frege wrapper for java Throwables.

Member Functions

caught ∷ Throwable → String

give the class name of this exception

getLocalizedMessage ∷ Throwable → String
pure native getLocalizedMessage
getMessage ∷ Throwable → String
pure native getMessage
printStackTrace ∷ Throwable → IO ()
native printStackTrace
strictTuple2 ∷ a → b → (a, b)
pure native PreludeBase.TTuple2.mk

Used to construct a strict tuple. Don't use anymore!

strictTuple3 ∷ a → b → c → (a, b, c)
pure native PreludeBase.TTuple3.mk

Constructs a strict 3-tuple. See remarks for strictTuple2.

strictTuple4 ∷ a → b → c → d → (a, b, c, d)
pure native PreludeBase.TTuple4.mk

Constructs a strict 4-tuple. See remarks for strictTuple2.

strictTuple5 ∷ a → b → c → d → e → (a, b, c, d, e)
pure native PreludeBase.TTuple5.mk

Constructs a strict 5-tuple. See remarks for strictTuple2.

strictTuple6 ∷ a → b → c → d → e → f → (a, b, c, d, e, f)
pure native PreludeBase.TTuple6.mk

Constructs a strict 6-tuple. See remarks for strictTuple2.

strictTuple7 ∷ a → b → c → d → e → f → g → (a, b, c, d, e, f, g)
pure native PreludeBase.TTuple7.mk

Constructs a strict 7-tuple. See remarks for strictTuple2.

strictTuple8 ∷ a → b → c → d → e → f → g → h → (a, b, c, d, e, f, g, h)
pure native PreludeBase.TTuple8.mk

Constructs a strict 8-tuple. See remarks for strictTuple2.

strictTuple9 ∷ a → b → c → d → e → f → g → h → i → (a, b, c, d, e, f, g, h, i)
pure native PreludeBase.TTuple9.mk

Constructs a strict 9-tuple. See remarks for strictTuple2.

strictTuple10 ∷ a → b → c → d → e → f → g → h → i → j → (a, b, c, d, e, f, g, h, i, j)
pure native PreludeBase.TTuple10.mk

Constructs a strict 10-tuple. See remarks for strictTuple2.

strictTuple11 ∷ a → b → c → d → e → f → g → h → i → j → k → (a, b, c, d, e, f, g, h, i, j, k)
pure native PreludeBase.TTuple11.mk

Constructs a strict 11-tuple. See remarks for strictTuple2.

strictTuple12 ∷ a → b → c → d → e → f → g → h → i → j → k → l → (a, b, c, d, e, f, g, h, i, j, k, l)
pure native PreludeBase.TTuple12.mk

Constructs a strict 12-tuple. See remarks for strictTuple2.

strictTuple13 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → (a, b, c, d, e, f, g, h, i, j, k, l, m)
pure native PreludeBase.TTuple13.mk

Constructs a strict 13-tuple. See remarks for strictTuple2.

strictTuple14 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
pure native PreludeBase.TTuple14.mk

Constructs a strict 14-tuple. See remarks for strictTuple2.

strictTuple15 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
pure native PreludeBase.TTuple15.mk

Constructs a strict 15-tuple. See remarks for strictTuple2.

strictTuple16 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
pure native PreludeBase.TTuple16.mk

Constructs a strict 16-tuple. See remarks for strictTuple2.

strictTuple17 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
pure native PreludeBase.TTuple17.mk

Constructs a strict 17-tuple. See remarks for strictTuple2.

strictTuple18 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
pure native PreludeBase.TTuple18.mk

Constructs a strict 18-tuple. See remarks for strictTuple2.

strictTuple19 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
pure native PreludeBase.TTuple19.mk

Constructs a strict 19-tuple. See remarks for strictTuple2.

strictTuple20 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
pure native PreludeBase.TTuple20.mk

Constructs a strict 20-tuple. See remarks for strictTuple2.

strictTuple21 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)
pure native PreludeBase.TTuple21.mk

Constructs a strict 21-tuple. See remarks for strictTuple2.

strictTuple22 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)
pure native PreludeBase.TTuple22.mk

Constructs a strict 22-tuple. See remarks for strictTuple2.

strictTuple23 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)
pure native PreludeBase.TTuple23.mk

Constructs a strict 23-tuple. See remarks for strictTuple2.

strictTuple24 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)
pure native PreludeBase.TTuple24.mk

Constructs a strict 24-tuple. See remarks for strictTuple2.

strictTuple25 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)
pure native PreludeBase.TTuple25.mk

Constructs a strict 25-tuple. See remarks for strictTuple2.

strictTuple26 ∷ a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → z → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)
pure native PreludeBase.TTuple26.mk

Constructs a strict 26-tuple. See remarks for strictTuple2.

seq ∷ 𝖆 → 𝖇 → 𝖇
infixr  2

a `seq` b evaluates a before it returns b

This is a right associative operator with precedence 15.

data Undefined = pure native frege.runtime.Undefined

An unchecked subclass of java.lang.RuntimeException for the Frege Runtime

An instance of Undefined will be thrown if undefined or (error msg) is evaluated.

Member Functions

die ∷ Undefined → Bool
pure native die

Throw this Undefined, this will abort the computation evaluating it.

Actually, the return type is not correct, since it never returns.

new ∷ String → Undefined
     | String → Throwable → Undefined
pure native new

create an Undefined value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

newX ∷ Throwable → Undefined

create an Undefined value from a cause (Throwable). The message will be taken from the cause.

new𝖆 ∷ String → Undefined
pure native new  overloads new

create an Undefined value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

new𝖇 ∷ String → Throwable → Undefined
pure native new  overloads new

create an Undefined value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

data NoMatch = pure native frege.runtime.NoMatch

A subclass of Undefined, used by the runtime to signal failed pattern matches

data GuardFailed = pure native frege.runtime.GuardFailed

A subclass of Undefined, used by the runtime to signal failed guards

data NumberFormatException = pure native java.lang.NumberFormatException

java.lang.NumberFormatException needed for string conversion operations

declared protected to avoid name conflicts with NumberFormatException

Member Functions

new ∷ String → NumberFormatException
     | String → Throwable → NumberFormatException
pure native new

create an NumberFormatException value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

new𝖆 ∷ String → NumberFormatException
pure native new  overloads new

create an NumberFormatException value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

new𝖇 ∷ String → Throwable → NumberFormatException
pure native new  overloads new

create an NumberFormatException value with a message (String) or with a message and a cause. The cause is another exception that caused this one.

data ClassNotFoundException = pure native java.lang.ClassNotFoundException

Forward declaration of ClassNotFoundException

undefined ∷ u

This is the standard undefined value.

error ∷ String → u

nowarn: application of error will diverge

Construct an undefined value with an informative message.

When evaluated, an Undefined exception will be thrown.

throw ∷ Throwable → 𝖆

nowarn: diverge

Constructs an undefined value from a java exception and throws it.

! ∷ Bool → Bool
pure native !

The Java ! operator on booleans

? ∷ Int → Int
pure native ~

complement

&& ∷ Bool → Bool → Bool
pure native &&
infixr  6

The Java && operator on booleans. Note that since this is a native function, the second argument appears strict to the compiler when in fact it is lazy at the Java level. This can lead to inconsistent results in some cases. For example, the following program correctly prints false in the first line of the output, but then aborts:

 main _ = do
    stdout << (false && undefined) << "\n"
    stdout << conj false undefined << "\n"
  where
    conj a b = a && b

Note that the very same behaviour is seen in the following java program

 public class And {
    static boolean undef() {
        if (true) throw new Error("undefined");
        return false;
    }
    static boolean conj(boolean a, boolean b) { return a&&b; }
    public static void main(String[] args) {
        System.out.println(false && undef());
        System.out.println(conj(false, undef()));
    }
 }

One could thus say that && behaves exactly like the Java operator including the fact that it cannot be replaced by a function without changing the semantics of a program.

For an alternative see und

|| ∷ Bool → Bool → Bool
pure native ||
infixr  5

The Java || operator on booleans.

Note that since this is a native function, the second argument appears strict to the compiler when in fact it is lazy at the Java level.

This can lead to inconsistent results in cases where the wrong strictness of the second argument propagates to arguments of the function that contains an application of ||. (The documentation for && has an example.)

See oder for an alternative

und ∷ Bool → Bool → Bool
infixr  6

Like &&, but second argument is lazy. The `und` operator has the same precedence and arity as &&. The definition is

 a `und` b = if a then b     else false

This should really be named and, but Haskell 2010 uses this already for lists. Hence we use the german word und.

oder ∷ Bool → Bool → Bool
infixr  5

Like ||, but second argument is lazy. The `oder` operator has the same precedence and arity as ||. The definition is

 a `oder`  b = if a then true  else b

This should really be named or, but Haskell 2010 uses this already for lists. Hence we use the german word oder.

not ∷ Bool → Bool
pure native !

not b is true if b is false, otherwise true. Uses java's ! operator.

^^ ∷ Bool → Bool → Bool
infixr  5

a ^^ b is true if either a or b is true, but not both.

 a ^^ b = if a then not b else b
=== ∷ a → a → Bool
pure native ==
infix  7

This checks for object identity or equality of primitive values using Java's == operator. It evaluates its arguments, so undefined values cannot be compared.

!== ∷ a → a → Bool
pure native !=
infix  7

This checks for object identity or inequality of primitive values using Java's != operator. It evaluates its arguments, so undefined values cannot be compared.

data Ordering

Ordering encodes the results of comparisons, see also Ord.<=>

Constructors

Eq
Gt
Lt
class Eq o ⇒ Ord o

The Ord class provides relational operators as well as the functions Ord.max and Ord.min. The default implementation defines them all in terms of the compare operator Ord.<=>.

Making some type an instance of Ord makes it automatically an instance of Eq if it is not one already and if it has an implementation for Eq.hashCode. The operators Eq.== and Eq.!= will be defined in terms of Ord.<=>.

Instances of Ord can be derived automatically for algebraic data types when all elements of the type are themselves instances of Ord and when the type is an instance of Eq.

Known Instances

Integer, Char, Bool, Float, Double, Int, StringJ, Long

Member Functions

!= ∷ Ord o ⇒ o → o → Bool
infix  7

This implementation for the (Eq.!=) operator is being used in instances of Ord when the instantiated type is not already an instance of Eq.

< ∷ Ord o ⇒ o → o → Bool
infix  9

Relational < operator. Obeys the following laws:

 if a < b && b < c then a < c
 a < b == b > a
<= ∷ Ord o ⇒ o → o → Bool
infix  9

Relational <= operator. Obeys the following laws:

 if a <= b && b <= c then a <= c
 a <= b == b >= a
 a <= b == !(a > b)
<=> ∷ Ord o ⇒ o → o → Ordering
infix  8

This operator must be defined in all instances. It compares its operands and returns Ordering.Lt if the first is lower than the second, Ordering.Gt if the first is greater than the second and Ordering.Eq otherwise.

The following shall be invariantly true:

 case a <=> b of { Eq -> a == b; _ -> a != b }
== ∷ Ord o ⇒ o → o → Bool
infix  7

This implementation for the (Eq.==) operator is being used in instances of Ord when the instantiated type is not already an instance of Eq.

> ∷ Ord o ⇒ o → o → Bool
infix  9

Relational > operator. Obeys the following laws:

 if a > b && b > c then a > c
 a > b == b < a
>= ∷ Ord o ⇒ o → o → Bool
infix  9

Relational >= operator. Obeys the following laws:

 if a >= b && b >= c then a >= c
 a >= b == b <= a
 a >= b == !(a < b)
compare ∷ Ord o ⇒ o → o → Ordering
infix  8
max ∷ Ord o ⇒ o → o → o
 max a b = if a > b then a else b   
min ∷ Ord o ⇒ o → o → o
 min a b = if a < b then a else b   
class (Eq e, Ord e) ⇒ Enum e

Class Enum defines operations on sequentially ordered types.

A type that is an instance of Enum is also an instance of Ord (and, in turn, of Eq).

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). If there is no Eq.hashCode provided, it will be the same as Enum.ord.

Enumeration types have special syntactic support with the range list:

 [a .. b]
 [a ..]
 [a,b .. c]
 [a,b ..]

Known Instances

Int, Bool, Char, Integer, Long

Member Functions

<=> ∷ Enum e ⇒ e → e → Ordering
infix  8

This is the default implementation of the compare operator, that makes each Enum type an Ord type automatically.

 a <=> b  =  (ord a).<=>  (ord b)
enumFrom ∷ Enum e ⇒ e → [e]

used in translating @[n..]

enumFromThen ∷ Enum e ⇒ e → e → [e]

used in translating @[n,n'..]

enumFromThenTo ∷ Enum e ⇒ e → e → e → [e]

used in translating @[n,n'..m]

enumFromTo ∷ Enum e ⇒ e → e → [e]

used in translating @[n..m]

from ∷ Enum e ⇒ Int → e

T.from i maps the Int value i to a value of T, such that

   ord (T.from i) == i

unless there is no value e of T so that ord e == i. In the latter case, the result is undefined.

hashCode ∷ Enum e ⇒ e → Int

default implementation for Eq.hashCode is same as Enum.ord

ord ∷ Enum e ⇒ e → Int

ord e returns the ordinal number associated with the value e. For enumeration types, Enum.ord is the same as constructor, for Int, it is the identity function. Some types, like Long, cannot map all their values to Int, in such cases the result of applying Enum.ord may be meaningless.

pred ∷ Enum e ⇒ e → e

pred e is the predecessor of e or undefined if there is no predecessor.

succ ∷ Enum e ⇒ e → e

succ e is the successor of e or undefined if there is no such successor.

class (Eq n, Ord n) ⇒ Num n

The Num class provides the operators (Num.+), (Num.-) and (Num.*) as well as some functions that are common for all numeric types.

Known Instances

Integer, Float, Double, Int, Long

Member Functions

* ∷ Num n ⇒ n → n → n
infixl  14

Computes the product of two numbers

+ ∷ Num n ⇒ n → n → n
infixl  13

Computes the sum of two numbers

- ∷ Num n ⇒ n → n → n
infixl  13

Computes the difference of two numbers

abs ∷ Num n ⇒ n → n

Computes the absolute value

fromInt ∷ Num n ⇒ Int → n

converts an Int value to the instantiated type

fromInteger ∷ Num n ⇒ Integer → n

converts an Integer value to the instantiated type

isInfinite ∷ Num n ⇒ n → Bool

Floating point number types may have special values for infinity and negative infinity. isFinite n yields true if n is an infinite value and false in all other cases.

The default implementation always returns false so that implementors of instances for types without special values for infinity need not care.

See also Num.isNumber.

isNaN ∷ Num n ⇒ n → Bool

Floating point number types may have a special values for not a number (NaN). For example, 0d / 0d is NaN. isNaN n yields true if n is the special value that indicates that n is not a number and false in all other cases.

The default implementation always returns false so that implementors of instances for types without such a special values need not care.

See also Num.isNumber.

isNumber ∷ Num n ⇒ n → Bool

Returns true if n is neither infinite (see Num.isInfinite) nor NaN (see Num.isNaN).

Note that certain properties for functions on numbers are true only under the assumption that the argument values are numbers.

The default implementation is

 isNumber n = !(isInfinite n) && !(isNaN n)

so that the function should always compute the right answer as long as Num.isInfinite and Num.isNaN do.

negate ∷ Num n ⇒ n → n

Negates a number n such that if n is a number

 n + negate n == 0   
one ∷ Num n ⇒ n

the number 1 in the instantiated type

sign ∷ Num n ⇒ n → Int

sign n is -1 if n<0, 1 if n>0 and 0 otherwise

subtract ∷ Num n ⇒ n → n → n

use (subtract a) instead of \\b -> b-a in sections

zero ∷ Num n ⇒ n

the number 0 in the instantiated type

class (Eq r, Ord r, Num r) ⇒ Real r

The Real class provides the division operator (Real./).

Known Instances

Float, Double

Member Functions

/ ∷ Real r ⇒ r → r → r
infixl  14

the division operator

fromDouble ∷ Real r ⇒ Double → r

convert a Double to any Real value

nan ∷ Real r ⇒ r
negativeInfinity ∷ Real r ⇒ r
positiveInfinity ∷ Real r ⇒ r

positive infinity, negative infinity and not a number

class (Eq i, Ord i, Num i) ⇒ Integral i

Class Integral provides division and remainder operations for integral numbers.

Known Instances

Integer, Int, Long

Member Functions

^ ∷ (Integral i, Num a) ⇒ a → i → a
infixr  15

x ^ n raise x to the n-th power

The exponent must be positive.

big ∷ Integral i ⇒ i → Integer

every integral number can be converted to a big Integer

div ∷ Integral i ⇒ i → i → i
infixl  14

integer division

divMod ∷ Integral i ⇒ i → i → (i, i)
even ∷ Integral i ⇒ i → Bool
fromIntegral ∷ (Integral i, Num b) ⇒ i → b

every Num can be made from an Integral

gcd ∷ Integral i ⇒ i → i → i

Integral.gcd x y is the non-negative factor of both x and y of which every common factor of x and y is also a factor; for example Integral.gcd 4 2 = 2, Integral.gcd (-4) 6 = 2, Integral.gcd 0 4 = 4. Integral.gcd 0 0 = 0. (That is, the common divisor that is \"greatest\" in the divisibility preordering.)

Note: Since for signed fixed-width integer types, Num.abs Bounded.minBound < 0, the result may be negative if one of the arguments is Bounded.minBound (and necessarily is if the other is 0 or Bounded.minBound) for such types.

gcdHelper ∷ Integral i ⇒ i → i → i

worker function for Integral.gcd, needs not pollute the namespace

lcm ∷ Integral i ⇒ i → i → i

Integral.lcm x y is the smallest positive integer that both x and y divide.

mod ∷ Integral i ⇒ i → i → i
infixl  14

This modulo operator works so that

 forAll arbitrary (\a -> forAll arbitrary (\b -> (a `div` b) * b + (a `mod` b) = a))

In addition, it is the case that

 forAll arbitrary (\a -> forAll arbitrary (\b -> @(a `quot` b) == (a `div` b) || (a `quot` b) == (a `div` b)-1))   
odd ∷ Integral i ⇒ i → Bool
powf ∷ (Integral i, Num a) ⇒ a → i → a

helper for Integral.^

powg ∷ (Integral i, Num a) ⇒ a → i → a → a

helper for Integral.^

quot ∷ Integral i ⇒ i → i → i
infixl  14
quotRem ∷ Integral i ⇒ i → i → (i, i)

Haskell compatibility

rem ∷ Integral i ⇒ i → i → i
infixl  14

The remainder á la Java operator % - a `rem` b has same sign as a

 forAll arbitrary (\a -> forAll arbitrary (\b -> (a `quot` b) * b + (a `rem` b) = a

This behaviour is the same as in Haskell

class Bounded b

A class for data types that have a lower and an upper bound.

Instances of Bounded can be derived automatically for enumeration types.

Known Instances

Int, Bool, Char, Long

Member Functions

maxBound ∷ Bounded b ⇒ b

the upper bound

minBound ∷ Bounded b ⇒ b

the lower bound

chr ∷ Int → Char
ctos ∷ Char → String
pure native java.lang.Character.toString

make a String from a single Char

data Maybe a

Constructors

Just a
Nothing
maybe ∷ 𝖆 → (𝖇→𝖆) → Maybe 𝖇 → 𝖆

The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Maybe.Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Maybe.Just and returns the result.

data (a | b)

Constructors

Left a
Right b
either ∷ (𝖇→𝖆) → (𝖈→𝖆) → (𝖇 | 𝖈) → 𝖆
infixl  2

apply first function to value in Either.Left or second function to value in Either.Right

fst ∷ (𝖆, 𝖇) → 𝖆

return the first element of a 2-tuple

snd ∷ (𝖇, 𝖆) → 𝖆

return the second element of a 2-tuple

!: ∷ 𝖆 → [𝖆] → [𝖆]
infixr  4

A head strict variant of (:)

This will be used in list comprehensions

id ∷ 𝖆 → 𝖆
$ ∷ (𝖇→𝖆) → 𝖇 → 𝖆
infixr  1

a $ b is the same as a b, but because of $'s low precedence one can write f $ x+y instead of f (x+y). Also, because $ is right associative, f $ g $ h y is f (g (h y))

$! ∷ (𝖇→𝖆) → 𝖇 → 𝖆
infixr  1

Same as `$` but argument is strict

const ∷ 𝖇 → 𝖆 → 𝖇

const a is a function that returns a regardless of its argument.

asTypeOf ∷ a → a → a

asTypeOf a b is a with the type of b.

This is a type restricted version of const.

flip ∷ (𝖇→𝖈→𝖆) → 𝖈 → 𝖇 → 𝖆

Exchange first and second argument of a function, i.e.

 flip f a b = f b a   
uncurry ∷ (𝖇→𝖈→𝖆) → (𝖇, 𝖈) → 𝖆

Passes the elements of a 2-tuple as arguments to a function.

curry ∷ ((𝖇, 𝖈)→𝖆) → 𝖇 → 𝖈 → 𝖆

curry f passes the next two arguments as 2-tuple to f

@ ∷ 𝖆 → 𝖇 → ()
infixr  2

In patterns, the @-operator is used to bind a name to a complex pattern

 f (x@a:as) = e

is the same as

 f arg = case arg of { x -> case x of { a:as -> e }}   
using ∷ Eq 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Bool

using f applies a projection function f on both sides of Eq.==. Example usage:

 uniqBy (using fst) [(1, 1), (2, 2), (2, 3), (3,4), (2,5)]
comparing ∷ Ord 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Ordering

comparing f applies a projection function on both sides of Ord.<=>. Example usage:

 sortBy (comparing snd) [(1, "z"), (2, "b")] == [(2, "b"), (1, "z")]
ascending ∷ Ord 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Ordering

Alias for comparing

descending ∷ Ord 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Ordering

descending f applies a projection function on both sides of Ord.<=>, but flips arguments. Example usage:

 sortBy (descending fst) [(1, "z"), (2, "b")] == [(2, "b"), (1, "z")]
on ∷ (𝖇→𝖇→𝖆) → (𝖈→𝖇) → 𝖈 → 𝖈 → 𝖆
infixl  1
 g `on` f

Apply a projection function f on both operands of g

 comparing f = (<=>) `on` f   
data ST s a

(ST s a) is an abstract data type and is a computation that encapsulates side effects in state thread s and returns a value of type a.

The type s can be understood as a compiler generated unique index for state threads. Every state thread is independent of each other and keeps track of mutable variables created in it. For detailed information, read the paper Lazy Functional State Threads.

Every mutable native data type shall be wrapped in a Mutable with phantom type parameter s. that tells to what state thread the value belongs. For example, the new method of the java class java.util.Date could be accessed like this:

 data Date s = native java.util.Date where
     native new :: Long -> ST s (Mutable s Date)

Inside ST actions, Date values can be created and manipulated with impure native methods at will. However, such a value can never escape its ST thread.

Because ST s is an instance of Monad, ST actions can be combined, which ensures sequenced execution. For example, we could add another method to the Date type that converts the date to a string:

     native toString :: Mutable s Date -> ST s String

and a computation which yields the current time in string form:

 epoch = do
    date <- Date.new 0L
    return date.toString

This looks almost like java already! epoch has type ST s String and we can run the computation with epoch.run (see ST.run below), which gives us a nice, pure, immutable, functional, correct String value.

The IO type is just an alias for ST RealWorld, and can be thought of as indexing a unique global state thread. Values of type IO a are also called IO actions.

Any ST value can also be used in the IO thread.

This guarantees that

Constructors

private ST (s → a)

Member Functions

>>= ∷ ST u a → (a → ST u b) → ST u b
infixl  3
performUnsafe ∷ IO a → a

warning: You are breaking the rules. Expect an arbitrary result and program crashes.

return ∷ 𝖇 → ST 𝖆 𝖇
run ∷ (∀ ß.ST ß a) → a

nowarn: performUnsafe

Run a stateful action with type ST r a and return a result of type a. The overall computation ST.run st is pure, though inside the ST action local mutable state can be employed.

This is possible only if the result type a of the state action does not mention r and if r is a type variable. Hence, it is not possible to ST.run an IO action.

data RealWorld = pure native frege.runtime.Phantom.RealWorld

This abstract data type identifies the global state (disk, network, you name it). Values of type ST RealWorld a are likely to perform input/output, manipulate global data and so on.

type IO = ST RealWorld

IO a is an abbreviation for ST RealWorld a

traceStr ∷ String → IO ()
native java.lang.System.err.print

warning: use stderr.print instead

print a String to the standard error stream

traceStrLn ∷ String → IO ()
native java.lang.System.err.println

warning: use stderr.println instead

print a String to the standard error stream and append a new line.

printStr ∷ String → IO ()
native java.lang.System.out.print

warning: use stdout.print instead

print a String to the standard output stream

printStrLn ∷ String → IO ()
native java.lang.System.out.println

warning: use stdout.println instead

print a String to the standard output stream and append a new line.

Instances

instance Bounded Bool

Member Functions

maxBound ∷ Bool
minBound ∷ Bool
instance Bounded Char

Member Functions

maxBound ∷ Char
pure native java.lang.Character.MAX_VALUE
minBound ∷ Char
pure native java.lang.Character.MIN_VALUE
instance Bounded Int

Member Functions

maxBound ∷ Int

the largest Int value 2147483647 (or (2**31)-1)

minBound ∷ Int

the smallest Int value -2147483648 (or -(2**31))

instance Bounded Long

Member Functions

maxBound ∷ Long

the largest Long value 9223372036854775807 (or (2**63)-1)

minBound ∷ Long

the smallest Long value -9223372036854775808 (or -(2**63))

instance Enum Bool

Member Functions

enumFrom ∷ Bool → [Bool]
enumFromThen ∷ Bool → Bool → [Bool]
enumFromThenTo ∷ Bool → Bool → Bool → [Bool]
enumFromTo ∷ Bool → Bool → [Bool]
from ∷ Int → Bool
ord ∷ Bool → Int
pred ∷ Bool → Bool
succ ∷ Bool → Bool
instance Enum Char

Member Functions

enumFrom ∷ Char → [Char]
enumFromThen ∷ Char → Char → [Char]
enumFromThenTo ∷ Char → Char → Char → [Char]
enumFromTo ∷ Char → Char → [Char]
from ∷ Int → Char
pure native (char)
ord ∷ Char → Int
pure native (int)

c.ord is the ordinal (integer) value of the character c. It holds: c.ord.char == c, see Int.char. (But note that i.char.ord is not necessarily i)

pred ∷ Char → Char
succ ∷ Char → Char
instance Enum Int

Member Functions

enumFrom ∷ Int → [Int]
enumFromThen ∷ Int → Int → [Int]
enumFromThenTo ∷ Int → Int → Int → [Int]
enumFromTo ∷ Int → Int → [Int]
from ∷ Int → Int
 from i = i   
ord ∷ Int → Int
 ord i = i   
pred ∷ Int → Int

pred i is the same as i-1 except for pred Int.minBound, which is undefined

succ ∷ Int → Int

succ i is the same as i+1 except for succ Int.maxBound, which is undefined

instance Enum Integer

Integer is an instance of Enum

Member Functions

enumFrom ∷ Integer → [Integer]
enumFromThen ∷ Integer → Integer → [Integer]
enumFromThenTo ∷ Integer → Integer → Integer → [Integer]
enumFromTo ∷ Integer → Integer → [Integer]
from ∷ Int → Integer

Integer.from i is the same as Int.big i

ord ∷ Integer → Int

ord b is only defined if the value of b is in the range Bounded_Int.minBound .. Bounded_Int.maxBound

pred ∷ Integer → Integer

succ b is the same as b + 1.big

succ ∷ Integer → Integer

succ b is the same as b + 1.big

instance Enum Long

Member Functions

enumFrom ∷ Long → [Long]
enumFromThen ∷ Long → Long → [Long]
enumFromThenTo ∷ Long → Long → Long → [Long]
enumFromTo ∷ Long → Long → [Long]
from ∷ Int → Long

Long.from i returns a Long with the same numeric value as i.

ord ∷ Long → Int

ord l is only valid if Int.minBound.long <= l && l <= Int.maxBound

pred ∷ Long → Long

pred a is the same as a-1L except for pred Long.minBound, which is undefined

succ ∷ Long → Long

succ a is the same as a+1L except for succ Long.maxBound, which is undefined

instance Eq ()

Member Functions

!= ∷ () → () → Bool
infix  7
== ∷ () → () → Bool
infix  7
hashCode ∷ () → Int
instance Eq Bool

Member Functions

!= ∷ Bool → Bool → Bool
pure native !=
infix  7
== ∷ Bool → Bool → Bool
pure native ==
infix  7
hashCode ∷ Bool → Int
instance Eq Char

Member Functions

!= ∷ Char → Char → Bool
pure native !=
infix  7
== ∷ Char → Char → Bool
pure native ==
infix  7
hashCode ∷ Char → Int
pure native (int)
instance Eq Double

Member Functions

!= ∷ Double → Double → Bool
pure native !=
infix  7
== ∷ Double → Double → Bool
pure native ==
infix  7
hashCode ∷ Double → Int

the Eq.hashCode is that of the Long value used to represent the Double

instance Eq Float

Member Functions

!= ∷ Float → Float → Bool
pure native !=
infix  7
== ∷ Float → Float → Bool
pure native ==
infix  7
hashCode ∷ Float → Int
pure native java.lang.Float.floatToIntBits

bit representation of a float serves as hashCode

instance Eq Int

Member Functions

!= ∷ Int → Int → Bool
pure native !=
infix  7

Uses the java != operator for comparison of Int values.

== ∷ Int → Int → Bool
pure native ==
infix  7

Uses the java == operator for comparison of Int values.

hashCode ∷ Int → Int

The Eq.hashCode of an Int is the identity

instance Eq Long

Member Functions

!= ∷ Long → Long → Bool
pure native !=
infix  7

Uses the java != operator for comparison of Long values.

== ∷ Long → Long → Bool
pure native ==
infix  7

Uses the java == operator for comparison of Long values.

hashCode ∷ Long → Int

hash code is upper half and lower half xor'ed

instance Eq String

Member Functions

!= ∷ String → String → Bool
infix  7
== ∷ String → String → Bool
pure native equals
infix  7
hashCode ∷ String → Int
pure native hashCode

get the hash code

instance Eq a ⇒ Eq [a]

Member Functions

!= ∷ Eq 𝖆 ⇒ [𝖆] → [𝖆] → Bool
infix  7

inherited from Eq.!=

== ∷ Eq 𝖆 ⇒ [𝖆] → [𝖆] → Bool
infix  7

two lists are equal if their heads and tails are equal or if the lists are empty

hashCode ∷ Eq 𝖆 ⇒ [𝖆] → Int
instance Integral Int

Member Functions

^ ∷ Num 𝖆 ⇒ 𝖆 → Int → 𝖆
infixr  15

inherited from Integral.^

big ∷ Int → Integer
div ∷ Int → Int → Int
infixl  14

inherited from Integral.div

divMod ∷ Int → Int → (Int, Int)

inherited from Integral.divMod

even ∷ Int → Bool
fromIntegral ∷ Num 𝖆 ⇒ Int → 𝖆

inherited from Integral.fromIntegral

gcd ∷ Int → Int → Int

inherited from Integral.gcd

gcdHelper ∷ Int → Int → Int

inherited from Integral.gcdHelper

lcm ∷ Int → Int → Int

inherited from Integral.lcm

mod ∷ Int → Int → Int
infixl  14

inherited from Integral.mod

odd ∷ Int → Bool
powf ∷ Num 𝖆 ⇒ 𝖆 → Int → 𝖆

inherited from Integral.powf

powg ∷ Num 𝖆 ⇒ 𝖆 → Int → 𝖆 → 𝖆

inherited from Integral.powg

quot ∷ Int → Int → Int
pure native /
infixl  14
quotRem ∷ Int → Int → (Int, Int)

inherited from Integral.quotRem

rem ∷ Int → Int → Int
pure native %
infixl  14
instance Integral Integer

Integer is an instance of Integral

Member Functions

* ∷ Integer → Integer → Integer
pure native multiply
infixl  14
+ ∷ Integer → Integer → Integer
pure native add
infixl  13
- ∷ Integer → Integer → Integer
pure native subtract
infixl  13
^ ∷ Num 𝖆 ⇒ 𝖆 → Integer → 𝖆
infixr  15

inherited from Integral.^

abs ∷ Integer → Integer
pure native abs
big ∷ Integer → Integer
div ∷ Integer → Integer → Integer
infixl  14

inherited from Integral.div

divMod ∷ Integer → Integer → (Integer, Integer)

inherited from Integral.divMod

even ∷ Integer → Bool
fromInt ∷ Int → Integer
fromInteger ∷ Integer → Integer
fromIntegral ∷ Num 𝖆 ⇒ Integer → 𝖆

inherited from Integral.fromIntegral

gcd ∷ Integer → Integer → Integer
pure native gcd
gcdHelper ∷ Integer → Integer → Integer

inherited from Integral.gcdHelper

isInfinite ∷ Integer → Bool

inherited from Num.isInfinite

isNaN ∷ Integer → Bool

inherited from Num.isNaN

isNumber ∷ Integer → Bool

inherited from Num.isNumber

lcm ∷ Integer → Integer → Integer

inherited from Integral.lcm

mod ∷ Integer → Integer → Integer
infixl  14

inherited from Integral.mod

negate ∷ Integer → Integer
pure native negate
odd ∷ Integer → Bool
one ∷ Integer
pure native java.math.BigInteger.ONE
powf ∷ Num 𝖆 ⇒ 𝖆 → Integer → 𝖆

inherited from Integral.powf

powg ∷ Num 𝖆 ⇒ 𝖆 → Integer → 𝖆 → 𝖆

inherited from Integral.powg

quot ∷ Integer → Integer → Integer
pure native divide
infixl  14
quotRem ∷ Integer → Integer → (Integer, Integer)

inherited from Integral.quotRem

rem ∷ Integer → Integer → Integer
pure native remainder
infixl  14
sign ∷ Integer → Int
pure native signum
subtract ∷ Integer → Integer → Integer

inherited from Num.subtract

zero ∷ Integer
pure native java.math.BigInteger.ZERO
instance Integral Long

Member Functions

^ ∷ Num 𝖆 ⇒ 𝖆 → Long → 𝖆
infixr  15

inherited from Integral.^

big ∷ Long → Integer
div ∷ Long → Long → Long
infixl  14

inherited from Integral.div

divMod ∷ Long → Long → (Long, Long)

inherited from Integral.divMod

even ∷ Long → Bool
fromIntegral ∷ Num 𝖆 ⇒ Long → 𝖆

inherited from Integral.fromIntegral

gcd ∷ Long → Long → Long

inherited from Integral.gcd

gcdHelper ∷ Long → Long → Long

inherited from Integral.gcdHelper

lcm ∷ Long → Long → Long

inherited from Integral.lcm

mod ∷ Long → Long → Long
infixl  14

inherited from Integral.mod

odd ∷ Long → Bool
powf ∷ Num 𝖆 ⇒ 𝖆 → Long → 𝖆

inherited from Integral.powf

powg ∷ Num 𝖆 ⇒ 𝖆 → Long → 𝖆 → 𝖆

inherited from Integral.powg

quot ∷ Long → Long → Long
pure native /
infixl  14
quotRem ∷ Long → Long → (Long, Long)

inherited from Integral.quotRem

rem ∷ Long → Long → Long
pure native %
infixl  14
instance Num Int

Member Functions

* ∷ Int → Int → Int
pure native *
infixl  14

Uses the java * operator to multiply 2 Int values.

+ ∷ Int → Int → Int
pure native +
infixl  13

Uses the java + operator to add 2 Int values.

- ∷ Int → Int → Int
pure native -
infixl  13

Uses the java - operator to subtract one Int value from another.

abs ∷ Int → Int

Returns the negated argument if it is negative, otherwise the argument itself.

This does not work for Bounded_Int.minBound since there is no corresponding positive value that can be represented as an Int. Rather

 abs Int.minBound == Int.minBound
fromInt ∷ Int → Int

For Int values, this is the identity function.

fromInteger ∷ Integer → Int
isInfinite ∷ Int → Bool

inherited from Num.isInfinite

isNaN ∷ Int → Bool

inherited from Num.isNaN

isNumber ∷ Int → Bool

inherited from Num.isNumber

negate ∷ Int → Int
pure native -

negate i computes 0-i using the java negation operator -.

This does not work for Bounded_Int.minBound since there is no corresponding positive value that can be represented as an Int. Rather

 negate Int.minBound == Int.minBound
one ∷ Int

the integer constant 1

sign ∷ Int → Int

inherited from Num.sign

subtract ∷ Int → Int → Int

inherited from Num.subtract

zero ∷ Int

the integer constant 0

instance Num Long

Member Functions

* ∷ Long → Long → Long
pure native *
infixl  14

Uses the java * operator to multiply two Long values.

+ ∷ Long → Long → Long
pure native +
infixl  13

Uses the java + operator to add two Long values.

- ∷ Long → Long → Long
pure native -
infixl  13

Uses the java - operator to subtract a Long value from another.

abs ∷ Long → Long

Returns the negated argument if it is negative, otherwise the argument itself.

This does not work for Bounded_Long.minBound since there is no corresponding positive value that can be represented as a Long. Rather

 abs Long.minBound == Long.minBound
fromInt ∷ Int → Long

applies the widening primitive conversion (JLS §5.1.2) from int to long

fromInteger ∷ Integer → Long
isInfinite ∷ Long → Bool

inherited from Num.isInfinite

isNaN ∷ Long → Bool

inherited from Num.isNaN

isNumber ∷ Long → Bool

inherited from Num.isNumber

negate ∷ Long → Long
pure native -

negate a computes 0L-a using the java negation operator -.

This does not work for Bounded_Long.minBound since there is no corresponding positive value that can be represented as a Long. Rather

 negate Long.minBound == Long.minBound
one ∷ Long

The constant 1L.

sign ∷ Long → Int

inherited from Num.sign

subtract ∷ Long → Long → Long

inherited from Num.subtract

zero ∷ Long

The constant 0L.

instance Ord Bool

Member Functions

< ∷ Bool → Bool → Bool
infix  9
<= ∷ Bool → Bool → Bool
infix  9
<=> ∷ Bool → Bool → Ordering
infix  8
> ∷ Bool → Bool → Bool
infix  9
>= ∷ Bool → Bool → Bool
infix  9
compare ∷ Bool → Bool → Ordering
infix  8

inherited from Ord.compare

max ∷ Bool → Bool → Bool

inherited from Ord.max

min ∷ Bool → Bool → Bool

inherited from Ord.min

instance Ord Char

Member Functions

< ∷ Char → Char → Bool
pure native <
infix  9
<= ∷ Char → Char → Bool
pure native <=
infix  9
<=> ∷ Char → Char → Ordering
infix  8
> ∷ Char → Char → Bool
pure native >
infix  9
>= ∷ Char → Char → Bool
pure native >=
infix  9
compare ∷ Char → Char → Ordering
infix  8

inherited from Ord.compare

max ∷ Char → Char → Char

inherited from Ord.max

min ∷ Char → Char → Char

inherited from Ord.min

instance Ord Double

Member Functions

< ∷ Double → Double → Bool
pure native <
infix  9
<= ∷ Double → Double → Bool
pure native <=
infix  9
<=> ∷ Double → Double → Ordering
infix  8
> ∷ Double → Double → Bool
pure native >
infix  9
>= ∷ Double → Double → Bool
pure native >=
infix  9
compare ∷ Double → Double → Ordering
infix  8

inherited from Ord.compare

max ∷ Double → Double → Double

inherited from Ord.max

min ∷ Double → Double → Double

inherited from Ord.min

instance Ord Float

Member Functions

< ∷ Float → Float → Bool
pure native <
infix  9
<= ∷ Float → Float → Bool
pure native <=
infix  9
<=> ∷ Float → Float → Ordering
infix  8
> ∷ Float → Float → Bool
pure native >
infix  9
>= ∷ Float → Float → Bool
pure native >=
infix  9
compare ∷ Float → Float → Ordering
infix  8

inherited from Ord.compare

max ∷ Float → Float → Float

inherited from Ord.max

min ∷ Float → Float → Float

inherited from Ord.min

instance Ord Int

Member Functions

< ∷ Int → Int → Bool
pure native <
infix  9

Uses the java < operator for comparison of Int values.

<= ∷ Int → Int → Bool
pure native <=
infix  9

Uses the java <= operator for comparison of Int values.

<=> ∷ Int → Int → Ordering
infix  8
> ∷ Int → Int → Bool
pure native >
infix  9

Uses the java > operator for comparison of Int values.

>= ∷ Int → Int → Bool
pure native >=
infix  9

Uses the java >= operator for comparison of Int values.

compare ∷ Int → Int → Ordering
infix  8

inherited from Ord.compare

max ∷ Int → Int → Int

inherited from Ord.max

min ∷ Int → Int → Int

inherited from Ord.min

instance Ord Integer

Integer is an instance of Ord

Member Functions

!= ∷ Integer → Integer → Bool
infix  7
< ∷ Integer → Integer → Bool
infix  9
<= ∷ Integer → Integer → Bool
infix  9
<=> ∷ Integer → Integer → Ordering
infix  8
== ∷ Integer → Integer → Bool
infix  7
> ∷ Integer → Integer → Bool
infix  9
>= ∷ Integer → Integer → Bool
infix  9
compare ∷ Integer → Integer → Ordering
infix  8

inherited from Ord.compare

hashCode ∷ Integer → Int
pure native hashCode
max ∷ Integer → Integer → Integer
pure native max
min ∷ Integer → Integer → Integer
pure native min
instance Ord Long

Member Functions

< ∷ Long → Long → Bool
pure native <
infix  9

Uses the java < operator for comparison of Long values.

<= ∷ Long → Long → Bool
pure native <=
infix  9

Uses the java <= operator for comparison of Long values.

<=> ∷ Long → Long → Ordering
infix  8
> ∷ Long → Long → Bool
pure native >
infix  9

Uses the java > operator for comparison of Long values.

>= ∷ Long → Long → Bool
pure native >=
infix  9

Uses the java >= operator for comparison of Long values.

compare ∷ Long → Long → Ordering
infix  8

inherited from Ord.compare

max ∷ Long → Long → Long

inherited from Ord.max

min ∷ Long → Long → Long

inherited from Ord.min

instance Ord String

Member Functions

< ∷ String → String → Bool
infix  9
<= ∷ String → String → Bool
infix  9
<=> ∷ String → String → Ordering
infix  8
> ∷ String → String → Bool
infix  9
>= ∷ String → String → Bool
infix  9
compare ∷ String → String → Ordering
infix  8

inherited from Ord.compare

max ∷ String → String → String

inherited from Ord.max

min ∷ String → String → String

inherited from Ord.min

instance Real Double

Member Functions

* ∷ Double → Double → Double
pure native *
infixl  14
+ ∷ Double → Double → Double
pure native +
infixl  13
- ∷ Double → Double → Double
pure native -
infixl  13
/ ∷ Double → Double → Double
pure native /
infixl  14
abs ∷ Double → Double

inherited from Num.abs

fromDouble ∷ Double → Double
fromInt ∷ Int → Double
fromInteger ∷ Integer → Double
isInfinite ∷ Double → Bool
pure native java.lang.Double.isInfinite
isNaN ∷ Double → Bool
pure native java.lang.Double.isNaN
isNumber ∷ Double → Bool

inherited from Num.isNumber

nan ∷ Double
pure native java.lang.Double.NaN

the NaN value provided by the Java runtime

negate ∷ Double → Double
pure native -
negativeInfinity ∷ Double
pure native java.lang.Double.NEGATIVE_INFINITY

negative infinity

one ∷ Double
positiveInfinity ∷ Double
pure native java.lang.Double.POSITIVE_INFINITY

positive infinity

sign ∷ Double → Int

inherited from Num.sign

subtract ∷ Double → Double → Double

inherited from Num.subtract

zero ∷ Double
instance Real Float

Member Functions

* ∷ Float → Float → Float
pure native *
infixl  14
+ ∷ Float → Float → Float
pure native +
infixl  13
- ∷ Float → Float → Float
pure native -
infixl  13
/ ∷ Float → Float → Float
pure native /
infixl  14
abs ∷ Float → Float

inherited from Num.abs

fromDouble ∷ Double → Float
fromInt ∷ Int → Float
fromInteger ∷ Integer → Float
isInfinite ∷ Float → Bool
pure native java.lang.Float.isInfinite
isNaN ∷ Float → Bool
pure native java.lang.Float.isNaN
isNumber ∷ Float → Bool

inherited from Num.isNumber

nan ∷ Float
pure native java.lang.Float.NaN

the NaN value provided by the Java runtime

negate ∷ Float → Float
pure native -
negativeInfinity ∷ Float
pure native java.lang.Float.NEGATIVE_INFINITY

negative infinity

one ∷ Float
positiveInfinity ∷ Float
pure native java.lang.Float.POSITIVE_INFINITY

positive infinity

sign ∷ Float → Int

inherited from Num.sign

subtract ∷ Float → Float → Float

inherited from Num.subtract

zero ∷ Float

Functions and Values by Type

String → String → Int → Int

StringJ.lastIndexOf𝖉, StringJ.indexOf𝖉

String → String → String

Ord_String.min, Ord_String.max, StringJ.concatenate

String → String → Bool

Eq_String.!=, Eq_String.==, Ord_String.>, Ord_String.<, Ord_String.<=, Ord_String.>=, StringJ.startsWith, StringJ.contentEquals, StringJ.contains

String → String → Int

StringJ.lastIndexOf𝖈, StringJ.indexOf𝖈, StringJ.compareTo, StringJ.compareToIgnoreCase

String → String → Ordering

Ord_String.compare, Ord_String.<=>

String → Char → Char → String

StringJ.replace

String → Char → Int → Int

StringJ.lastIndexOf𝖇, StringJ.indexOf𝖇

String → Char → Int

StringJ.lastIndexOf𝖆, StringJ.indexOf𝖆

String → Int → Int → Int

StringJ.codePointCount

String → Int → Char

StringJ.charAt

String → Int → Int

StringJ.codePointAt, StringJ.codePointBefore

String → Throwable → NumberFormatException

NumberFormatException.new𝖇

String → Throwable → Undefined

Undefined.new𝖇

String → (NumberFormatException | Double)

StringJ.double

String → (NumberFormatException | Float)

StringJ.float

String → (NumberFormatException | Int)

StringJ.int

String → (NumberFormatException | Integer)

StringJ.integer

String → (NumberFormatException | Long)

StringJ.long

String → IO ()

printStr, printStrLn, traceStr, traceStrLn, StringJ.wait, StringJ.notifyAll, StringJ.notify

String → String

StringJ.toUpperCase, StringJ.trim, StringJ.toLowerCase, StringJ.quoteReplacement, StringJ.quote

String → Bool

StringJ.isEmpty

String → Double

StringJ.atod

String → Float

StringJ.atof

String → Int

atoi, Eq_String.hashCode, StringJ.atoi

String → Integer

StringJ.aton

String → Long

StringJ.atol

String → NumberFormatException

NumberFormatException.new𝖆

String → Undefined

Undefined.new𝖆

() → () → Bool

Eq_().!=, Eq_().==

() → Int

Eq_().hashCode

Bool → Bool → Bool → [Bool]

Enum_Bool.enumFromThenTo

Bool → Bool → [Bool]

Enum_Bool.enumFromTo, Enum_Bool.enumFromThen

Bool → Bool → Bool

&&, ^^, oder, und, ||, Eq_Bool.!=, Eq_Bool.==, Ord_Bool.min, Ord_Bool.max, Ord_Bool.>, Ord_Bool.<, Ord_Bool.<=, Ord_Bool.>=

Bool → Bool → Ordering

Ord_Bool.compare, Ord_Bool.<=>

Bool → [Bool]

Enum_Bool.enumFrom

Bool → Bool

!, not, Enum_Bool.succ, Enum_Bool.pred

Bool → Int

Enum_Bool.ord, Eq_Bool.hashCode

Char → Char → Char → [Char]

Enum_Char.enumFromThenTo

Char → Char → [Char]

Enum_Char.enumFromTo, Enum_Char.enumFromThen

Char → Char → Bool

Eq_Char.!=, Eq_Char.==, Ord_Char.>, Ord_Char.<, Ord_Char.<=, Ord_Char.>=, Char.isSurrogatePair

Char → Char → Char

Ord_Char.min, Ord_Char.max

Char → Char → Int

Char.toCodePoint

Char → Char → Ordering

Ord_Char.compare, Ord_Char.<=>

Char → Int → Int

Char.digit

Char → Maybe String

Char.getName𝖆

Char → String

ctos

Char → [Char]

Enum_Char.enumFrom

Char → Bool

Char.isUpperCase𝖆, Char.isWhitespace𝖆, Char.isSurrogate, Char.isLowSurrogate, Char.isLetter𝖆, Char.isLowerCase𝖆, Char.isLetterOrDigit𝖆, Char.isHighSurrogate, Char.isDigit𝖆, Char.isDefined𝖆, Char.isISOControl𝖆

Char → Char

Enum_Char.pred, Enum_Char.succ, Char.toUpperCase𝖆, Char.toTitleCase𝖆, Char.toLowerCase𝖆

Char → Int

Enum_Char.ord, Eq_Char.hashCode, Char.getType𝖆

Double → Double → Bool

Eq_Double.!=, Eq_Double.==, Ord_Double.>, Ord_Double.<, Ord_Double.<=, Ord_Double.>=

Double → Double → Double

Ord_Double.min, Ord_Double.max, Real_Double.subtract, Real_Double./, Real_Double.+, Real_Double.*, Real_Double.-

Double → Double → Ordering

Ord_Double.compare, Ord_Double.<=>

Double → Bool

Real_Double.isNaN, Real_Double.isInfinite, Real_Double.isNumber

Double → Double

Real_Double.negate, Real_Double.abs, Real_Double.fromDouble

Double → Float

Real_Float.fromDouble, Double.float

Double → Int

Eq_Double.hashCode, Real_Double.sign

Double → Long

Double.long, Double.longBits

Float → Float → Bool

Eq_Float.!=, Eq_Float.==, Ord_Float.>, Ord_Float.<, Ord_Float.<=, Ord_Float.>=

Float → Float → Float

Ord_Float.min, Ord_Float.max, Real_Float.subtract, Real_Float./, Real_Float.+, Real_Float.*, Real_Float.-

Float → Float → Ordering

Ord_Float.compare, Ord_Float.<=>

Float → Bool

Real_Float.isNaN, Real_Float.isInfinite, Real_Float.isNumber

Float → Double

Float.double

Float → Float

Real_Float.negate, Real_Float.abs

Float → Int

Eq_Float.hashCode, Real_Float.sign, Float.int

Int → Int → Int → [Int]

Enum_Int.enumFromThenTo

Int → Int → (Int, Int)

Integral_Int.quotRem, Integral_Int.divMod

Int → Int → [Int]

Enum_Int.enumFromTo, Enum_Int.enumFromThen

Int → Int → Bool

Eq_Int.!=, Eq_Int.==, Ord_Int.>, Ord_Int.<, Ord_Int.<=, Ord_Int.>=

Int → Int → Char

Char.forDigit

Int → Int → Int

Integral_Int.rem, Integral_Int.quot, Integral_Int.mod, Integral_Int.gcdHelper, Integral_Int.gcd, Integral_Int.div, Integral_Int.lcm, Num_Int.subtract, Num_Int.-, Num_Int.*, Num_Int.+, Ord_Int.min, Ord_Int.max, Int.ushiftR, Int.shiftL, Int.shiftR, Int.rotateL, Int.rotateR, Int..^., Int..&., Int..|.

Int → Int → Ordering

Ord_Int.compare, Ord_Int.<=>

Int → Maybe String

Char.getName𝖇

Int → String

Int.toHexString, StringJ.intToString

Int → [Int]

Enum_Int.enumFrom

Int → Bool

Enum_Bool.from, Integral_Int.odd, Integral_Int.even, Num_Int.isNaN, Num_Int.isNumber, Num_Int.isInfinite, Char.isWhitespace𝖇, Char.isValidCodePoint, Char.isUpperCase𝖇, Char.isLowerCase𝖇, Char.isSupplementaryCodePoint, Char.isLetter𝖇, Char.isISOControl𝖇, Char.isLetterOrDigit𝖇, Char.isDigit𝖇, Char.isDefined𝖇

Int → Char

chr, Enum_Char.from, Char.lowSurrogate, Char.highSurrogate, Int.char

Int → Double

Real_Double.fromInt, Int.double

Int → Float

Real_Float.fromInt, Int.float

Int → Int

?, Enum_Int.succ, Enum_Int.ord, Enum_Int.from, Enum_Int.pred, Eq_Int.hashCode, Num_Int.negate, Num_Int.sign, Num_Int.fromInt, Num_Int.abs, Char.toUpperCase𝖇, Char.toTitleCase𝖇, Char.toLowerCase𝖇, Char.getType𝖇, Int.complement

Int → Integer

Enum_Integer.from, Integral_Int.big, Integral_Integer.fromInt

Int → Long

Enum_Long.from, Num_Long.fromInt, Int.long

Integer → Int → Integer

Integer.ushiftR, Integer.shiftR, Integer.shiftL

Integer → Integer → Integer → [Integer]

Enum_Integer.enumFromThenTo

Integer → Integer → (Integer, Integer)

Integral_Integer.quotRem, Integral_Integer.divMod

Integer → Integer → [Integer]

Enum_Integer.enumFromThen, Enum_Integer.enumFromTo

Integer → Integer → Bool

Ord_Integer.>, Ord_Integer.==, Ord_Integer.!=, Ord_Integer.<, Ord_Integer.<=, Ord_Integer.>=

Integer → Integer → Int

Integer.compareTo

Integer → Integer → Integer

Integral_Integer.subtract, Integral_Integer.quot, Integral_Integer.rem, Integral_Integer.lcm, Integral_Integer.mod, Integral_Integer.gcd, Integral_Integer.gcdHelper, Integral_Integer.div, Integral_Integer.+, Integral_Integer.*, Integral_Integer.-, Ord_Integer.min, Ord_Integer.max, Integer.nMod, Integer..^., Integer..&., Integer..|.

Integer → Integer → Ordering

Ord_Integer.compare, Ord_Integer.<=>

Integer → String

Integer.toString

Integer → [Integer]

Enum_Integer.enumFrom

Integer → Bool

Integral_Integer.odd, Integral_Integer.isNaN, Integral_Integer.isInfinite, Integral_Integer.even, Integral_Integer.isNumber

Integer → Double

Real_Double.fromInteger, Integer.double

Integer → Float

Real_Float.fromInteger

Integer → Int

Enum_Integer.ord, Integral_Integer.sign, Num_Int.fromInteger, Ord_Integer.hashCode, Integer.int, Integer.bitLength

Integer → Integer

Enum_Integer.succ, Enum_Integer.pred, Integral_Integer.negate, Integral_Integer.fromInteger, Integral_Integer.big, Integral_Integer.abs, Integer.complement

Integer → Long

Num_Long.fromInteger, Integer.long

Long → Int → Long

Long.ushiftR, Long.shiftL, Long.rotateL, Long.rotateR, Long.shiftR

Long → Long → Long → [Long]

Enum_Long.enumFromThenTo

Long → Long → (Long, Long)

Integral_Long.quotRem, Integral_Long.divMod

Long → Long → [Long]

Enum_Long.enumFromTo, Enum_Long.enumFromThen

Long → Long → Bool

Eq_Long.!=, Eq_Long.==, Ord_Long.>, Ord_Long.<, Ord_Long.<=, Ord_Long.>=

Long → Long → Long

Integral_Long.rem, Integral_Long.quot, Integral_Long.mod, Integral_Long.gcdHelper, Integral_Long.gcd, Integral_Long.div, Integral_Long.lcm, Num_Long.subtract, Num_Long.-, Num_Long.*, Num_Long.+, Ord_Long.min, Ord_Long.max, Long..^., Long..&., Long..|.

Long → Long → Ordering

Ord_Long.compare, Ord_Long.<=>

Long → [Long]

Enum_Long.enumFrom

Long → Bool

Integral_Long.odd, Integral_Long.even, Num_Long.isNaN, Num_Long.isNumber, Num_Long.isInfinite

Long → Double

Long.double

Long → Float

Long.float

Long → Int

Enum_Long.ord, Eq_Long.hashCode, Num_Long.sign, Long.int

Long → Integer

Integral_Long.big, Integer.valueOf

Long → Long

Enum_Long.succ, Enum_Long.pred, Num_Long.negate, Num_Long.abs, Long.complement

Object → IO ()

Object.wait, Object.notify, Object.notifyAll

Throwable → IO ()

Throwable.printStackTrace

Throwable → String

Throwable.getMessage, Throwable.caught, Throwable.getLocalizedMessage

Throwable → Undefined

Undefined.newX

Undefined → Bool

Undefined.die

()

().()

Bool

otherwise, Bounded_Bool.minBound, Bounded_Bool.maxBound

Char

Bounded_Char.minBound, Bounded_Char.maxBound

Double

Real_Double.zero, Real_Double.one, Real_Double.positiveInfinity, Real_Double.nan, Real_Double.negativeInfinity

Float

Real_Float.zero, Real_Float.one, Real_Float.positiveInfinity, Real_Float.nan, Real_Float.negativeInfinity

HaskellBool

HaskellBool.False, HaskellBool.True

Int

Bounded_Int.minBound, Bounded_Int.maxBound, Num_Int.zero, Num_Int.one, Int.size, Long.size

Integer

Integral_Integer.zero, Integral_Integer.one, Integer.ten

Long

Bounded_Long.minBound, Bounded_Long.maxBound, Num_Long.zero, Num_Long.one

Ordering

Ordering.Lt, Ordering.Eq, Ordering.Gt

IO a → a

ST.performUnsafe

Class a → String

Class.getName

String → a → String

StringJ.format𝖆

String → IO (ClassNotFoundException | Class a)

Class.forName

String → u

error

StringJ a → StringJ a → StringJ a

StringJ.++

StringJ a → Int → Int → StringJ a

substr, StringJ.substr

StringJ a → Int → StringJ a

strtail

StringJ a → Int → a

StringJ.polymorphicElemAt

StringJ a → Int

StringJ.length

Bool → 𝖆 → 𝖆 → 𝖆

lazyif

Throwable → 𝖆

throw

a → [a] → [a]

[].:

a → a → Bool

!==, ===

a → a → a

asTypeOf

a → Class a

Object.getClass

a → Maybe a

Maybe.Just

a → Int

constructor

𝖆 → [𝖆] → [𝖆]

!:

𝖆 → 𝖆 → Bool → 𝖆

bool

𝖆 → 𝖆

id

(∀ ß.ST ß a) → a

ST.run

Enum e ⇒ Int → e

Enum.from

Enum e ⇒ e → e → e → [e]

Enum.enumFromThenTo

Enum e ⇒ e → e → [e]

Enum.enumFromTo, Enum.enumFromThen

Enum e ⇒ e → e → Ordering

Enum.<=>

Enum e ⇒ e → [e]

Enum.enumFrom

Enum e ⇒ e → Int

Enum.ord, Enum.hashCode

Enum e ⇒ e → e

Enum.succ, Enum.pred

Eq e ⇒ e → e → Bool

Eq.!=, Eq.==

Eq e ⇒ e → Int

Eq.hashCode

Eq 𝖆 ⇒ [𝖆] → [𝖆] → Bool

Eq_[].!=, Eq_[].==

Eq 𝖆 ⇒ [𝖆] → Int

Eq_[].hashCode

Integral i ⇒ i → i → (i, i)

Integral.quotRem, Integral.divMod

Integral i ⇒ i → i → i

Integral.rem, Integral.mod, Integral.quot, Integral.gcdHelper, Integral.gcd, Integral.div, Integral.lcm

Integral i ⇒ i → Bool

Integral.odd, Integral.even

Integral i ⇒ i → Integer

Integral.big

Num n ⇒ Int → n

Num.fromInt

Num n ⇒ Integer → n

Num.fromInteger

Num n ⇒ n → n → n

Num.subtract, Num.-, Num.*, Num.+

Num n ⇒ n → Bool

Num.isInfinite, Num.isNaN, Num.isNumber

Num n ⇒ n → Int

Num.sign

Num n ⇒ n → n

Num.negate, Num.abs

Num 𝖆 ⇒ Int → 𝖆

Integral_Int.fromIntegral

Num 𝖆 ⇒ Integer → 𝖆

Integral_Integer.fromIntegral

Num 𝖆 ⇒ Long → 𝖆

Integral_Long.fromIntegral

Num 𝖆 ⇒ 𝖆 → Int → 𝖆 → 𝖆

Integral_Int.powg

Num 𝖆 ⇒ 𝖆 → Int → 𝖆

Integral_Int.powf, Integral_Int.^

Num 𝖆 ⇒ 𝖆 → Integer → 𝖆 → 𝖆

Integral_Integer.powg

Num 𝖆 ⇒ 𝖆 → Integer → 𝖆

Integral_Integer.powf, Integral_Integer.^

Num 𝖆 ⇒ 𝖆 → Long → 𝖆 → 𝖆

Integral_Long.powg

Num 𝖆 ⇒ 𝖆 → Long → 𝖆

Integral_Long.powf, Integral_Long.^

Ord o ⇒ o → o → Bool

Ord.>=, Ord.==, Ord.<=, Ord.!=, Ord.<, Ord.>

Ord o ⇒ o → o → Ordering

Ord.compare, Ord.<=>

Ord o ⇒ o → o → o

Ord.min, Ord.max

Real r ⇒ Double → r

Real.fromDouble

Real r ⇒ r → r → r

Real./

Maybe a

Maybe.Nothing

[a]

[].[]

u

undefined

ω

Char.toUpperCase, Char.toTitleCase, Char.toLowerCase, Char.isWhitespace, Char.isUpperCase, Char.isLowerCase, Char.isLetter, Char.isLetterOrDigit, Char.isISOControl, Char.isDigit, Char.isDefined, Char.getType, Char.getName, NumberFormatException.new, StringJ.indexOf, StringJ.lastIndexOf, StringJ.format, Undefined.new

Bounded b ⇒ b

Bounded.minBound, Bounded.maxBound

Num n ⇒ n

Num.zero, Num.one

Real r ⇒ r

Real.positiveInfinity, Real.nan, Real.negativeInfinity

(s → a) → ST s a

ST.ST

(𝖆, 𝖇) → 𝖆

fst

(𝖇, 𝖆) → 𝖆

snd

(𝖇→𝖆) → 𝖇 → 𝖆

$, $!

String → a → b → String

StringJ.format𝖇

a → b → (a, b)

strictTuple2

a → b → (a, b)

(,).(,)

a → (a | b)

Either.Left

b → (a | b)

Either.Right

𝖆 → (𝖇→𝖆) → Maybe 𝖇 → 𝖆

maybe

𝖆 → 𝖇 → ()

@

𝖆 → 𝖇 → 𝖇

seq

𝖇 → 𝖆 → 𝖇

const

𝖇 → ST 𝖆 𝖇

ST.return

Eq 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Bool

using

(Integral i, Num a) ⇒ a → i → a → a

Integral.powg

(Integral i, Num a) ⇒ a → i → a

Integral.powf, Integral.^

(Integral i, Num b) ⇒ i → b

Integral.fromIntegral

Ord 𝖇 ⇒ (𝖆→𝖇) → 𝖆 → 𝖆 → Ordering

comparing, descending

((𝖇, 𝖈)→𝖆) → 𝖇 → 𝖈 → 𝖆

curry

(𝖇→𝖇→𝖆) → (𝖈→𝖇) → 𝖈 → 𝖈 → 𝖆

on

(𝖇→𝖈→𝖆) → (𝖇, 𝖈) → 𝖆

uncurry

(𝖇→𝖈→𝖆) → 𝖈 → 𝖇 → 𝖆

flip

(𝖇→𝖆) → (𝖈→𝖆) → (𝖇 | 𝖈) → 𝖆

either

ST u a → (a → ST u b) → ST u b

ST.>>=

String → a → b → c → String

StringJ.format𝖈

a → b → c → (a, b, c)

strictTuple3

a → b → c → (a, b, c)

(,,).(,,)

String → a → b → c → d → String

StringJ.format𝖉

a → b → c → d → (a, b, c, d)

strictTuple4

a → b → c → d → (a, b, c, d)

(,,,).(,,,)

String → a → b → c → d → e → String

StringJ.format𝖊

a → b → c → d → e → (a, b, c, d, e)

strictTuple5

a → b → c → d → e → (a, b, c, d, e)

(,,,,).(,,,,)

String → a → b → c → d → e → f → String

StringJ.format𝖋

a → b → c → d → e → f → (a, b, c, d, e, f)

strictTuple6

a → b → c → d → e → f → (a, b, c, d, e, f)

(,,,,,).(,,,,,)

String → a → b → c → d → e → f → g → String

StringJ.format𝖌

a → b → c → d → e → f → g → (a, b, c, d, e, f, g)

strictTuple7

a → b → c → d → e → f → g → (a, b, c, d, e, f, g)

(,,,,,,).(,,,,,,)

String → a → b → c → d → e → f → g → h → String

StringJ.format𝖍

a → b → c → d → e → f → g → h → (a, b, c, d, e, f, g, h)

strictTuple8

a → b → c → d → e → f → g → h → (a, b, c, d, e, f, g, h)

(,,,,,,,).(,,,,,,,)

String → a → b → c → d → e → f → g → h → i → String

StringJ.format𝖎

a → b → c → d → e → f → g → h → i → (a, b, c, d, e, f, g, h, i)

strictTuple9

a → b → c → d → e → f → g → h → i → (a, b, c, d, e, f, g, h, i)

(,,,,,,,,).(,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → (a, b, c, d, e, f, g, h, i, j)

strictTuple10

a → b → c → d → e → f → g → h → i → j → (a, b, c, d, e, f, g, h, i, j)

(,,,,,,,,,).(,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → (a, b, c, d, e, f, g, h, i, j, k)

strictTuple11

a → b → c → d → e → f → g → h → i → j → k → (a, b, c, d, e, f, g, h, i, j, k)

(,,,,,,,,,,).(,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → (a, b, c, d, e, f, g, h, i, j, k, l)

strictTuple12

a → b → c → d → e → f → g → h → i → j → k → l → (a, b, c, d, e, f, g, h, i, j, k, l)

(,,,,,,,,,,,).(,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → (a, b, c, d, e, f, g, h, i, j, k, l, m)

strictTuple13

a → b → c → d → e → f → g → h → i → j → k → l → m → (a, b, c, d, e, f, g, h, i, j, k, l, m)

(,,,,,,,,,,,,).(,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

strictTuple14

a → b → c → d → e → f → g → h → i → j → k → l → m → n → (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

(,,,,,,,,,,,,,).(,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

strictTuple15

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

(,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)

strictTuple16

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)

(,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)

strictTuple17

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)

(,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)

strictTuple18

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)

(,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)

strictTuple19

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)

(,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)

strictTuple20

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)

(,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)

strictTuple21

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)

(,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)

strictTuple22

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)

(,,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)

strictTuple23

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)

(,,,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)

strictTuple24

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)

(,,,,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)

strictTuple25

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)

(,,,,,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,,,,,)

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → z → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

strictTuple26

a → b → c → d → e → f → g → h → i → j → k → l → m → n → o → p → q → r → s → t → u → v → w → x → y → z → (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

(,,,,,,,,,,,,,,,,,,,,,,,,,).(,,,,,,,,,,,,,,,,,,,,,,,,,)

Valid HTML 4.01 Strict