numhask-0.11.1.0: A numeric class hierarchy.
Safe HaskellSafe-Inferred
LanguageGHC2021

NumHask.Data.Complex

Description

Complex numbers.

Synopsis

Documentation

newtype Complex a Source #

The underlying representation is a newtype-wrapped tuple, compared with the base datatype. This was chosen to facilitate the use of DerivingVia.

Constructors

Complex 

Fields

Instances

Instances details
Functor Complex Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

fmap :: (a -> b) -> Complex a -> Complex b #

(<$) :: a -> Complex b -> Complex a #

Data a => Data (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a) #

toConstr :: Complex a -> Constr #

dataTypeOf :: Complex a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a)) #

gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

Generic (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Associated Types

type Rep (Complex a) :: Type -> Type #

Methods

from :: Complex a -> Rep (Complex a) x #

to :: Rep (Complex a) x -> Complex a #

Read a => Read (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Show a => Show (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

showsPrec :: Int -> Complex a -> ShowS #

show :: Complex a -> String #

showList :: [Complex a] -> ShowS #

Eq a => Eq (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

(==) :: Complex a -> Complex a -> Bool #

(/=) :: Complex a -> Complex a -> Bool #

Additive a => Additive (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

(+) :: Complex a -> Complex a -> Complex a Source #

zero :: Complex a Source #

Subtractive a => Subtractive (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

negate :: Complex a -> Complex a Source #

(-) :: Complex a -> Complex a -> Complex a Source #

(Ord a, TrigField a, ExpField a) => ExpField (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

(Eq (Whole a), Ring (Whole a), QuotientField a) => QuotientField (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Associated Types

type Whole (Complex a) Source #

BoundedJoinSemiLattice a => BoundedJoinSemiLattice (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

bottom :: Complex a Source #

BoundedMeetSemiLattice a => BoundedMeetSemiLattice (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

top :: Complex a Source #

JoinSemiLattice a => JoinSemiLattice (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

(\/) :: Complex a -> Complex a -> Complex a Source #

MeetSemiLattice a => MeetSemiLattice (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

(/\) :: Complex a -> Complex a -> Complex a Source #

(ExpField a, Eq a) => Basis (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Associated Types

type Mag (Complex a) Source #

type Base (Complex a) Source #

TrigField a => Direction (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Associated Types

type Dir (Complex a) Source #

Methods

angle :: Complex a -> Dir (Complex a) Source #

ray :: Dir (Complex a) -> Complex a Source #

Epsilon a => Epsilon (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

epsilon :: Complex a Source #

(Subtractive a, Divisive a) => Divisive (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

recip :: Complex a -> Complex a Source #

(/) :: Complex a -> Complex a -> Complex a Source #

(Subtractive a, Multiplicative a) => Multiplicative (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

(*) :: Complex a -> Complex a -> Complex a Source #

one :: Complex a Source #

(Distributive a, Subtractive a) => InvolutiveRing (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

adj :: Complex a -> Complex a Source #

(Additive a, FromIntegral a b) => FromIntegral (Complex a) b Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

fromIntegral :: b -> Complex a Source #

type Rep (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

type Rep (Complex a) = D1 ('MetaData "Complex" "NumHask.Data.Complex" "numhask-0.11.1.0-EApRBSOlfGg2K23zs0vJ5I" 'True) (C1 ('MetaCons "Complex" 'PrefixI 'True) (S1 ('MetaSel ('Just "complexPair") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a, a))))
type Whole (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

type Whole (Complex a) = Complex (Whole a)
type Base (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

type Dir (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

type Dir (Complex a) = Dir (EuclideanPair a)
type Mag (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

type Mag (Complex a) = Mag (EuclideanPair a)

(+:) :: a -> a -> Complex a infixl 6 Source #

Complex number constructor.

realPart :: Complex a -> a Source #

Extracts the real part of a complex number.

imagPart :: Complex a -> a Source #

Extracts the imaginary part of a complex number.