jonathanfishbein1/complex-numbers/4.0.0

NOTE: the latest version is 11.0.1

ComplexNumbers

A module for complex numbers

Types

type Real r
= Real r

Real portion

type Imaginary i
= Imaginary i

Imaginary portion

= ComplexNumberCartesian (Real a) (Imaginary a)

Cartesian representation of a complex number

Arithmetic operations on complex numbers

The number i

Extracts the real part of a complex number

Extracts the imaginary part of a complex number

Add two complex numbers together

sum : Monoid (ComplexNumberCartesian number)

Monoidally add two complex numbers together

Multiply two complex numbers together

Monoidally multiply two complex numbers together

Subtract two complex numbers together

Divide two complex numbers together

Calculate the modulus of a complex number

Calculate the conjugate of a complex number

convertFromCartesianToPolar : ComplexNumberCartesian Float -> ComplexNumberPolar Float

Convert from the Cartesian representation of a complex number to the polar representation

convertFromPolarToCartesian : ComplexNumberPolar Float -> ComplexNumberCartesian Float

Convert from the polar representation of a complex number to the Cartesian representation

Map over a complex number

Place a value in the minimal Complex Number Cartesian context

Apply for Complex Number Cartesian representaiton applicative

Monadic bind for Complex Number Cartesian representaiton

Compare two ComplexNumbers for equality

Calculate a complex number raised to a power

read : String -> Result (List DeadEnd) (ComplexNumberCartesian Float)

Read ComplexNumber

print : ComplexNumberCartesian Float -> String

Print ComplexNumber