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.

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 #

HasUncertainty UncertainChunk Source #

Finds the uncertainty of an UncertainChunk.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

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.