rel8-1.5.0.0: Hey! Hey! Can u rel8?
Safe HaskellSafe-Inferred
LanguageHaskell2010

Rel8.Expr.Num

Synopsis

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, this 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.

divMod :: Sql DBIntegral a => Expr a -> Expr a -> (Expr a, Expr a) Source #

Simultaneous div and mod.

quot :: Sql DBIntegral a => Expr a -> Expr a -> Expr a Source #

Perform integral division. Corresponds to the div() function in PostgreSQL, which behaves like Haskell's quot rather than div.

rem :: Sql DBIntegral a => Expr a -> Expr a -> Expr a Source #

Corresponds to the mod() function in PostgreSQL, which behaves like Haskell's rem rather than mod.

quotRem :: Sql DBIntegral a => Expr a -> Expr a -> (Expr a, Expr a) Source #

Simultaneous quot and rem.

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.