Introduction To Haskell
Built-In Functions

Overview

All of the operators that were used here are functions in Haskell. They are called infix functions. This is because they are positioned in between their arguments/parameters.

Most functions are prefix functions, the function is written first and followed by its arguments. Here are some examples of functions that are available to use straight away.

FunctionDescription
succReturns the successor or next item in the list.
predReturns the predecessor or previous item in the list.
minReturns the lowest of two arguments.
maxReturns the highest of two arguments.
divReturns the integer part of the result of dividing the first of two arguments by the second.
modReturns the remainder resulting from the first argument being divided by the second.
gcdReturns the greatest common divisor (highest common factor).
lcmReturns the lowest common multiple.
evenReturns True or False depending on whether the argument is even or not.
oddReturns True or False depending on whether the argument is odd or not.

succ & pred

WinGHCI

min & max

WinGHCI

div & mod

WinGHCI

gcd & lcm

WinGHCI

even & odd

WinGHCI