Hoogle Search

Within LTS Haskell 24.49 (ghc-9.10.3)

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

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

    safe-decimal Numeric.Decimal

    Convert a bounded integeral into a decimal, while performing the necessary scaling

    >>> import Numeric.Decimal
    
    >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int)
    1234.0000
    
    >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int16)
    *** Exception: arithmetic overflow
    

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

    safe-decimal Numeric.Decimal

    No documentation available.

  3. fromRationalDecimalBoundedWithoutLoss :: forall m (s :: Nat) p r . (MonadThrow m, KnownNat s, Integral p, Bounded p) => Rational -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Convert a Rational to a bounded Decimal, but only if there is no precision loss or Overflow/Undeflow.

  4. fromScientificDecimalBounded :: forall m r (s :: Nat) p . (MonadThrow m, Integral p, Bounded p, KnownNat s) => Scientific -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Convert from Scientific to bounded Decimal while checking for Overflow/Underflow

  5. integralDecimalToDecimalBounded :: forall p' p (s :: Nat) m r . (Integral p', Integral p, Bounded p, KnownNat s, MonadThrow m) => Decimal r s p' -> m (Decimal r s p)

    safe-decimal Numeric.Decimal

    Convert a decimal backed by an integral to another decimal backed by a bounded integeral, while checking for Overflow/Underflow

    >>> import Numeric.Decimal
    
    >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int)
    1234.0000
    
    >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int16)
    *** Exception: arithmetic overflow
    

  6. 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.

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

  8. 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.

  9. 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
    

  10. 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.

Page 45 of many | Previous | Next