dimensional-1.0.1.1: Statically checked physical dimensions, using Type Families and Data Kinds.

CopyrightCopyright (C) 2006-2015 Bjorn Buckwalter
LicenseBSD3
Maintainerbjorn@buckwalter.se
StabilityStable
PortabilityGHC only
Safe HaskellSafe
LanguageHaskell2010

Numeric.Units.Dimensional.Dimensions.TermLevel

Contents

Description

This module defines physical dimensions expressed in terms of the SI base dimensions, including arithmetic.

Synopsis

Type

data Dimension' Source

A physical dimension, encoded as 7 integers, representing a factorization of the dimension into the 7 SI base dimensions. By convention they are stored in the same order as in the Dimension data kind.

Constructors

Dim' !Int !Int !Int !Int !Int !Int !Int 

Instances

Access to Dimension of Dimensional Values

class HasDimension a where Source

Dimensional values inhabit this class, which allows access to a term-level representation of their dimension.

Methods

dimension :: a -> Dimension' Source

Obtains a term-level representation of a value's dimension.

Dimension Arithmetic

(*) :: Dimension' -> Dimension' -> Dimension' infixl 7 Source

Forms the product of two dimensions.

(/) :: Dimension' -> Dimension' -> Dimension' infixl 7 Source

Forms the quotient of two dimensions.

(^) :: Dimension' -> Int -> Dimension' infixr 8 Source

Raises a dimension to an integer power.

recip :: Dimension' -> Dimension' Source

Forms the reciprocal of a dimension.

Synonyms for Base Dimensions

dOne :: Dimension' Source

The dimension of dimensionless values.

Deconstruction

asList :: Dimension' -> [Int] Source

Converts a dimension to a list of 7 integers, representing the exponent associated with each of the 7 SI base dimensions in the standard order.