| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.Uncertainty
Description
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.
Instances
| Generic Uncertainty Source # | |
Defined in Language.Drasil.Uncertainty Associated Types type Rep Uncertainty :: Type -> Type # | |
| HasChunkRefs Uncertainty Source # | |
Defined in Language.Drasil.Uncertainty Methods chunkRefs :: Uncertainty -> Set UID # | |
| type Rep Uncertainty Source # | |
Defined in Language.Drasil.Uncertainty type Rep Uncertainty = D1 ('MetaData "Uncertainty" "Language.Drasil.Uncertainty" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'False) (C1 ('MetaCons "Uncert" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uncert") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "_prec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)))) | |
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).
Instances
| HasUncertainty UncertQ Source # | Finds the uncertainty of an |
Defined in Language.Drasil.Chunk.UncertainQuantity Methods unc :: Lens' UncertQ 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.