| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Numeric.LogDomain
Description
This module provides log-domain functionality. Ed Kmett provides, with
log-domain, a generic way to handle numbers in the log-domain, some which
is used under the hood here. We want some additional type safety and also
connect with the SemiRing module.
Synopsis
- class LogDomain x where
- type Ln x :: *
- logdom :: MonadError String m => x -> m (Ln x)
- unsafelogdom :: x -> Ln x
- lindom :: Ln x -> x
Documentation
class LogDomain x where Source #
Instances for LogDomain x should be for specific types.
Associated Types
The type family to connect a type x with the type Ln x in the
log-domain.
Methods
logdom :: MonadError String m => x -> m (Ln x) Source #
Transport a value in x into the log-domain. logdom should throw an
exception if log x is not valid.
unsafelogdom :: x -> Ln x Source #
Unsafely transport x into the log-domain.
Transport a value Ln x back into the linear domain x.