HPM Education - Haskell

Searchβ¦

Introduction

Types in Haskell

Defining Functions / Working with Functions

List Comprehensions

Higher-order Functions

Cutom Types

Type Classes

Interactive Programming

Functors, Applicatives and Monads

Fractional β Fractional Types

The

`Integral`

class extends the `Num`

class and supports two additional methods for working with floating-point numbers, fractional division and reciprocation:(/) :: a -> a -> a

recip :: a -> a

β

ghci> 5.0 / 2.0

2.5

β

ghci> recip 10 -- reciprocal is simply 1 / x

0.1

Last modified 1yr ago

Copy link