numhask-0.8.1.0: A numeric class hierarchy.
Safe HaskellNone
LanguageHaskell2010

NumHask.Data.Complex

Description

Complex numbers.

Synopsis

Documentation

data Complex a Source #

Complex numbers have real and imaginary parts.

The Foldable and Traversable instances traverse the real part first.

Constructors

!a :+ !a infix 6

forms a complex number from its real and imaginary rectangular components.

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 #

Foldable Complex Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

fold :: Monoid m => Complex m -> m #

foldMap :: Monoid m => (a -> m) -> Complex a -> m #

foldMap' :: Monoid m => (a -> m) -> Complex a -> m #

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

foldr' :: (a -> b -> b) -> b -> Complex a -> b #

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

foldl' :: (b -> a -> b) -> b -> Complex a -> b #

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

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

toList :: Complex a -> [a] #

null :: Complex a -> Bool #

length :: Complex a -> Int #

elem :: Eq a => a -> Complex a -> Bool #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

sum :: Num a => Complex a -> a #

product :: Num a => Complex a -> a #

Traversable Complex Source # 
Instance details

Defined in NumHask.Data.Complex

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) #

sequenceA :: Applicative f => Complex (f a) -> f (Complex a) #

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) #

sequence :: Monad m => Complex (m a) -> m (Complex a) #

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

Defined in NumHask.Data.Complex

Methods

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

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

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) #

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 #

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 #

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 #

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, 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 #

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

Defined in NumHask.Data.Complex

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

Defined in NumHask.Data.Complex

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

Defined in NumHask.Data.Complex

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

Defined in NumHask.Data.Complex

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

Defined in NumHask.Data.Complex

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

Defined in NumHask.Data.Complex

Methods

top :: Complex a Source #

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

Defined in NumHask.Data.Complex

Methods

bottom :: Complex a Source #

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

Defined in NumHask.Data.Complex

Methods

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

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

Defined in NumHask.Data.Complex

Methods

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

(Ord a, Signed a, Subtractive a, Epsilon a) => Epsilon (Complex a) Source # 
Instance details

Defined in NumHask.Data.Complex

Generic1 Complex Source # 
Instance details

Defined in NumHask.Data.Complex

Associated Types

type Rep1 Complex :: k -> Type #

Methods

from1 :: forall (a :: k). Complex a -> Rep1 Complex a #

to1 :: forall (a :: k). Rep1 Complex a -> Complex a #

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

Defined in NumHask.Data.Complex

Methods

fromIntegral :: b -> Complex a Source #

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

Defined in NumHask.Data.Complex

Methods

angle :: Complex a -> a Source #

ray :: a -> Complex a Source #

ExpField a => Norm (Complex a) a Source #

A euclidean-style norm is strong convention for Complex.

Instance details

Defined in NumHask.Data.Complex

Methods

norm :: Complex a -> a Source #

basis :: Complex a -> 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.8.1.0-6vtGETGPv6z5KBqA0pprnK" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))
type Rep1 Complex Source # 
Instance details

Defined in NumHask.Data.Complex

type Rep1 Complex = D1 ('MetaData "Complex" "NumHask.Data.Complex" "numhask-0.8.1.0-6vtGETGPv6z5KBqA0pprnK" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))

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.