drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Uncertainty

Description

Defines uncertainty types and functions.

Synopsis

Type

data Uncertainty Source #

Something that may contain an uncertainty value and a precision value.

Instances

Instances details
Generic Uncertainty Source # 
Instance details

Defined in Language.Drasil.Uncertainty

Associated Types

type Rep Uncertainty :: Type -> Type #

HasChunkRefs Uncertainty Source # 
Instance details

Defined in Language.Drasil.Uncertainty

type Rep Uncertainty Source # 
Instance details

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

Methods

unc :: Lens' c Uncertainty Source #

Provides the Lens to an Uncertainty.

Instances

Instances details
HasUncertainty UncertQ Source #

Finds the uncertainty of an UncertQ.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

unc :: Lens' UncertQ Uncertainty Source #

Lenses

Constructors

uncty :: Double -> Maybe Int -> Uncertainty Source #

Smart constructor for values with uncertainty.

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.

uncPrec :: HasUncertainty x => x -> Maybe Int Source #

Accessor for precision value from something that has an uncertainty.