Safe Haskell | None |
---|---|
Language | Haskell2010 |
Rel8.Expr.Num
Synopsis
- fromIntegral :: (Sql DBIntegral a, Sql DBNum b, Homonullable a b) => Expr a -> Expr b
- realToFrac :: (Sql DBNum a, Sql DBFractional b, Homonullable a b) => Expr a -> Expr b
- div :: Sql DBIntegral a => Expr a -> Expr a -> Expr a
- mod :: Sql DBIntegral a => Expr a -> Expr a -> Expr a
- divMod :: Sql DBIntegral a => Expr a -> Expr a -> (Expr a, Expr a)
- quot :: Sql DBIntegral a => Expr a -> Expr a -> Expr a
- rem :: Sql DBIntegral a => Expr a -> Expr a -> Expr a
- quotRem :: Sql DBIntegral a => Expr a -> Expr a -> (Expr a, Expr a)
- ceiling :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b
- floor :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b
- round :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b
- truncate :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b
Documentation
fromIntegral :: (Sql DBIntegral a, Sql DBNum b, Homonullable a b) => Expr a -> Expr b Source #
Cast DBIntegral
types to DBNum
types. For example, this can be useful
if you need to turn an Expr Int32
into an Expr Double
.
realToFrac :: (Sql DBNum a, Sql DBFractional b, Homonullable a b) => Expr a -> Expr b Source #
Cast DBNum
types to DBFractional
types. For example, his can be useful
to convert Expr Float
to Expr Double
.
div :: Sql DBIntegral a => Expr a -> Expr a -> Expr a Source #
Emulates the behaviour of the Haskell function div
in
PostgreSQL.
mod :: Sql DBIntegral a => Expr a -> Expr a -> Expr a Source #
Emulates the behaviour of the Haskell function mod
in
PostgreSQL.
ceiling :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b Source #
Round a DBFractional
to a DBIntegral
by rounding to the nearest larger
integer.
Corresponds to the ceiling()
function.
floor :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b Source #
Round a DFractional
to a DBIntegral
by rounding to the nearest smaller
integer.
Corresponds to the floor()
function.
round :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b Source #
Round a DBFractional
to a DBIntegral
by rounding to the nearest
integer.
Corresponds to the round()
function.
truncate :: (Sql DBFractional a, Sql DBIntegral b, Homonullable a b) => Expr a -> Expr b Source #
Round a DBFractional
to a DBIntegral
by rounding to the nearest
integer towards zero.