accelerate-1.3.0.0: An embedded language for accelerated array processing

Copyright[2019..2020] The Accelerate Team
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.Data.Ratio

Contents

Description

Standard functions on rational numbers

Since: 1.3.0.0

Synopsis

Documentation

data Ratio a #

Rational numbers, with numerator and denominator of some Integral type.

Note that Ratio's instances inherit the deficiencies from the type parameter's. For example, Ratio Natural's Num instance has similar problems to Natural's.

Instances
NFData1 Ratio

Available on base >=4.9

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Ratio a -> () #

Pretty Rational 
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Methods

pretty :: Rational -> Doc b #

prettyList :: [Rational] -> Doc b #

(FromIntegral a b, Integral b) => FromIntegral a (Ratio b) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

fromIntegral :: Exp a -> Exp (Ratio b) Source #

Integral a => Enum (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

succ :: Ratio a -> Ratio a #

pred :: Ratio a -> Ratio a #

toEnum :: Int -> Ratio a #

fromEnum :: Ratio a -> Int #

enumFrom :: Ratio a -> [Ratio a] #

enumFromThen :: Ratio a -> Ratio a -> [Ratio a] #

enumFromTo :: Ratio a -> Ratio a -> [Ratio a] #

enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] #

Integral a => Enum (Exp (Ratio a)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

succ :: Exp (Ratio a) -> Exp (Ratio a) #

pred :: Exp (Ratio a) -> Exp (Ratio a) #

toEnum :: Int -> Exp (Ratio a) #

fromEnum :: Exp (Ratio a) -> Int #

enumFrom :: Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromThen :: Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromTo :: Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromThenTo :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

Eq a => Eq (Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Real

Methods

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

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

Integral a => Fractional (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

(/) :: Ratio a -> Ratio a -> Ratio a #

recip :: Ratio a -> Ratio a #

fromRational :: Rational -> Ratio a #

Integral a => Fractional (Exp (Ratio a)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

(/) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

recip :: Exp (Ratio a) -> Exp (Ratio a) #

fromRational :: Rational -> Exp (Ratio a) #

Integral a => Num (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

(+) :: Ratio a -> Ratio a -> Ratio a #

(-) :: Ratio a -> Ratio a -> Ratio a #

(*) :: Ratio a -> Ratio a -> Ratio a #

negate :: Ratio a -> Ratio a #

abs :: Ratio a -> Ratio a #

signum :: Ratio a -> Ratio a #

fromInteger :: Integer -> Ratio a #

Integral a => Num (Exp (Ratio a)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

(+) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

(-) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

(*) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

negate :: Exp (Ratio a) -> Exp (Ratio a) #

abs :: Exp (Ratio a) -> Exp (Ratio a) #

signum :: Exp (Ratio a) -> Exp (Ratio a) #

fromInteger :: Integer -> Exp (Ratio a) #

Integral a => Ord (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

compare :: Ratio a -> Ratio a -> Ordering #

(<) :: Ratio a -> Ratio a -> Bool #

(<=) :: Ratio a -> Ratio a -> Bool #

(>) :: Ratio a -> Ratio a -> Bool #

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

max :: Ratio a -> Ratio a -> Ratio a #

min :: Ratio a -> Ratio a -> Ratio a #

(Integral a, Read a) => Read (Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Read

Integral a => Real (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

toRational :: Ratio a -> Rational #

Integral a => RealFrac (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

properFraction :: Integral b => Ratio a -> (b, Ratio a) #

truncate :: Integral b => Ratio a -> b #

round :: Integral b => Ratio a -> b #

ceiling :: Integral b => Ratio a -> b #

floor :: Integral b => Ratio a -> b #

Show a => Show (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

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

show :: Ratio a -> String #

showList :: [Ratio a] -> ShowS #

Generic (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Orphans

Associated Types

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

Methods

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

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

Integral a => Lift (Ratio a) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Ratio a -> Q Exp #

(Storable a, Integral a) => Storable (Ratio a)

Since: base-4.8.0.0

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Ratio a -> Int #

alignment :: Ratio a -> Int #

peekElemOff :: Ptr (Ratio a) -> Int -> IO (Ratio a) #

pokeElemOff :: Ptr (Ratio a) -> Int -> Ratio a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ratio a) #

pokeByteOff :: Ptr b -> Int -> Ratio a -> IO () #

peek :: Ptr (Ratio a) -> IO (Ratio a) #

poke :: Ptr (Ratio a) -> Ratio a -> IO () #

NFData a => NFData (Ratio a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ratio a -> () #

Hashable a => Hashable (Ratio a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Ratio a -> Int #

hash :: Ratio a -> Int #

(Integral a, FromIntegral a Int64) => RealFrac (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Elt a => Elt (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Associated Types

type EltR (Ratio a) :: Type

Methods

eltR :: TypeR (EltR (Ratio a))

tagsR :: [TagR (EltR (Ratio a))]

fromElt :: Ratio a -> EltR (Ratio a)

toElt :: EltR (Ratio a) -> Ratio a

Integral a => Eq (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

(==) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(/=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

Integral a => Ord (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

(<) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(>) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(<=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(>=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

min :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) Source #

max :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) Source #

compare :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Ordering Source #

(Integral a, ToFloating a b) => ToFloating (Ratio a) b Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Ratio

Methods

toFloating :: Exp (Ratio a) -> Exp b Source #

type Rep (Ratio a) Source # 
Instance details

Defined in Data.Array.Accelerate.Orphans

(%) :: Integral a => Exp a -> Exp a -> Exp (Ratio a) infixl 7 Source #

Form the ratio of two integral numbers

pattern (:%) :: Elt a => Exp a -> Exp a -> Exp (Ratio a) Source #

numerator :: Exp (Ratio a) -> Elt a -> Exp a Source #

denominator :: Exp (Ratio a) -> Elt a -> Exp a Source #

Orphan instances

(FromIntegral a b, Integral b) => FromIntegral a (Ratio b) Source # 
Instance details

Methods

fromIntegral :: Exp a -> Exp (Ratio b) Source #

Integral a => Enum (Exp (Ratio a)) Source # 
Instance details

Methods

succ :: Exp (Ratio a) -> Exp (Ratio a) #

pred :: Exp (Ratio a) -> Exp (Ratio a) #

toEnum :: Int -> Exp (Ratio a) #

fromEnum :: Exp (Ratio a) -> Int #

enumFrom :: Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromThen :: Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromTo :: Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

enumFromThenTo :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) -> [Exp (Ratio a)] #

Integral a => Fractional (Exp (Ratio a)) Source # 
Instance details

Methods

(/) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

recip :: Exp (Ratio a) -> Exp (Ratio a) #

fromRational :: Rational -> Exp (Ratio a) #

Integral a => Num (Exp (Ratio a)) Source # 
Instance details

Methods

(+) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

(-) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

(*) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) #

negate :: Exp (Ratio a) -> Exp (Ratio a) #

abs :: Exp (Ratio a) -> Exp (Ratio a) #

signum :: Exp (Ratio a) -> Exp (Ratio a) #

fromInteger :: Integer -> Exp (Ratio a) #

(Integral a, FromIntegral a Int64) => RealFrac (Ratio a) Source # 
Instance details

Elt a => Elt (Ratio a) Source # 
Instance details

Associated Types

type EltR (Ratio a) :: Type

Methods

eltR :: TypeR (EltR (Ratio a))

tagsR :: [TagR (EltR (Ratio a))]

fromElt :: Ratio a -> EltR (Ratio a)

toElt :: EltR (Ratio a) -> Ratio a

Integral a => Eq (Ratio a) Source # 
Instance details

Methods

(==) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(/=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

Integral a => Ord (Ratio a) Source # 
Instance details

Methods

(<) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(>) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(<=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

(>=) :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Bool Source #

min :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) Source #

max :: Exp (Ratio a) -> Exp (Ratio a) -> Exp (Ratio a) Source #

compare :: Exp (Ratio a) -> Exp (Ratio a) -> Exp Ordering Source #

(Integral a, ToFloating a b) => ToFloating (Ratio a) b Source # 
Instance details

Methods

toFloating :: Exp (Ratio a) -> Exp b Source #