Hoogle Search

Within LTS Haskell 24.31 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. minusDecimalBounded :: forall m p r (s :: Nat) . (MonadThrow m, Eq p, Ord p, Num p, Bounded p) => Decimal r s p -> Decimal r s p -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Subtract two decimal numbers.

  2. parseDecimalBounded :: forall r (s :: Nat) p . (KnownNat s, Bounded p, Integral p) => Bool -> String -> Either String (Decimal r s p)

    safe-decimal Numeric.Decimal

    No documentation available.

  3. plusDecimalBounded :: forall m p r (s :: Nat) . (MonadThrow m, Eq p, Ord p, Num p, Bounded p) => Decimal r s p -> Decimal r s p -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Add two decimal numbers.

  4. productDecimalBoundedWithRounding :: forall m f (s :: Nat) r p . (MonadThrow m, Foldable f, KnownNat s, Round r Integer, Integral p, Bounded p) => f (Decimal r s p) -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Multiply all decimal numbers in the list while doing rounding.

    >>> :set -XDataKinds
    
    >>> product [1.1, 20.02, 300.003] :: Double
    6606.666066000001
    
    >>> xs <- arithM (mapM fromRational [1.1, 20.02, 300.003] :: Arith [Decimal RoundHalfUp 4 Int])
    
    >>> xs
    [1.1000,20.0200,300.0030]
    
    >>> productDecimalBoundedWithRounding xs
    6606.6661
    

  5. quotRemDecimalBounded :: forall m r (s :: Nat) p . (MonadThrow m, Integral p, Bounded p) => Decimal r s p -> Integer -> m (Decimal r s p, Decimal r s p)

    safe-decimal Numeric.Decimal

    No documentation available.

  6. scaleUpBounded :: forall (k :: Nat) r (n :: Nat) p m . (MonadThrow m, Integral p, Bounded p, KnownNat k) => Decimal r n p -> m (Decimal r (n + k) p)

    safe-decimal Numeric.Decimal

    Increase the precision of a Decimal backed by a bounded type, use roundDecimal if inverse is desired.

    >>> import Numeric.Decimal
    
    >>> d2 <- arithM (1.65 :: Arith (Decimal RoundHalfUp 2 Int16))
    
    >>> scaleUpBounded d2 :: IO (Decimal RoundHalfUp 3 Int16)
    1.650
    
    >>> scaleUpBounded d2 :: IO (Decimal RoundHalfUp 4 Int16)
    1.6500
    
    >>> scaleUpBounded d2 :: IO (Decimal RoundHalfUp 5 Int16)
    *** Exception: arithmetic overflow
    

  7. signumDecimalBounded :: forall (s :: Nat) m p r . (KnownNat s, MonadThrow m, Integral p, Bounded p) => Decimal r s p -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Compute signum of a decimal, always one of 1, 0 or -1

  8. sumDecimalBounded :: forall m f p r (s :: Nat) . (MonadThrow m, Foldable f, Eq p, Ord p, Num p, Bounded p) => f (Decimal r s p) -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Sum a list of decimal numbers

    >>> :set -XDataKinds
    
    >>> sequenceA [1.1, 20.02, 300.003] >>= sumDecimalBounded :: Arith (Decimal RoundHalfUp 3 Int)
    Arith 321.123
    

  9. timesDecimalBounded :: forall m p r (s1 :: Nat) (s2 :: Nat) . (MonadThrow m, Integral p, Bounded p) => Decimal r s1 p -> Decimal r s2 p -> m (Decimal r (s1 + s2) p)

    safe-decimal Numeric.Decimal

    Multiply two bounded decimal numbers, adjusting their scale at the type level as well.

  10. timesDecimalBoundedWithRounding :: forall m (s :: Nat) r p . (MonadThrow m, KnownNat s, Round r Integer, Integral p, Bounded p) => Decimal r s p -> Decimal r s p -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Multiply two decimal numbers, while rounding the result according to the rounding strategy.

Page 45 of many | Previous | Next