HPM Education - Haskell

Searchβ¦

Introduction

Types in Haskell

Defining Functions / Working with Functions

List Comprehensions

Higher-order Functions

Cutom Types

Interactive Programming

Functors, Applicatives and Monads

Basic Types

Bool β logical values

`True`

or `False`

.Int β fixed-precision integers

`-50`

, `50`

) up to a certain size which is limited by a fixed amount of memory, hence the term fixed-precision. GHC can hold values in the range of `(-2^63)`

to `(2^63 - 1)`

for Int types - going outside those ranges will yield unexpected results.Integer β arbitrary-precision integers

Float β single-precision floating-point numbers

`-1.5`

, `6.23`

, `50.0`

) up to a certain precision which is limited by a fixed amount of memory. The term floating-point comes from this memory limitation, which limits the number of digits (precision) that can come after the decimal point based on the size of the number.Double β double-precision floating-point numbers

Char β single character

`'\n'`

(a new line character) or `'\t'`

(tab stop character). Chars must be enclosed in single quotes `' '`

. String β strings of characters

`[Char]`

(a list of characters) in Haskell. Strings must be enclosed in double-quotes `" "`

, e.g. `"Haskell is great"`

.Last modified 1yr ago

Copy link

Outline

Bool β logical values

Int β fixed-precision integers

Integer β arbitrary-precision integers

Float β single-precision floating-point numbers

Double β double-precision floating-point numbers

Char β single character

String β strings of characters