Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines uncertainty types and functions.
Synopsis
- data Uncertainty
- class HasUncertainty c where
- unc :: Lens' c Uncertainty
- uncert :: Lens' Uncertainty (Maybe Double)
- prec :: Lens' Uncertainty (Maybe Int)
- uncty :: Double -> Maybe Int -> Uncertainty
- exact :: Uncertainty
- defaultUncrt :: Uncertainty
- uncVal :: HasUncertainty x => x -> Double
- uncPrec :: HasUncertainty x => x -> Maybe Int
Type
data Uncertainty Source #
Something that may contain an uncertainty value and a precision value.
Class
class HasUncertainty c where Source #
HasUncertainty is just a chunk with some uncertainty associated to it. This uncertainty is represented as a decimal value between 0 and 1 (percentage).
unc :: Lens' c Uncertainty Source #
Provides the Lens
to an Uncertainty
.
Instances
HasUncertainty UncertQ Source # | Finds the uncertainty of an |
Defined in Language.Drasil.Chunk.UncertainQuantity unc :: Lens' UncertQ Uncertainty Source # | |
HasUncertainty UncertainChunk Source # | Finds the uncertainty of an |
Defined in Language.Drasil.Chunk.UncertainQuantity unc :: Lens' UncertainChunk Uncertainty Source # |
Lenses
Constructors
exact :: Uncertainty Source #
Smart constructor for exact values (no uncertainty).
Constructor
defaultUncrt :: Uncertainty Source #
The default uncertainty is set to 0.1.
Accessors
uncVal :: HasUncertainty x => x -> Double Source #
Accessor for uncertainty value from something that has an uncertainty.