haskellator-0.1.0.0: SI-Units supporting calculator
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.Haskellator.Internal.Units

Description

Everything related to units. See Math.Haskellator.Internal.TH.UnitGeneration for what is available here.

Synopsis

Documentation

data Unit Source #

Instances

Instances details
Bounded Unit Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Enum Unit Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

succ :: Unit -> Unit #

pred :: Unit -> Unit #

toEnum :: Int -> Unit #

fromEnum :: Unit -> Int #

enumFrom :: Unit -> [Unit] #

enumFromThen :: Unit -> Unit -> [Unit] #

enumFromTo :: Unit -> Unit -> [Unit] #

enumFromThenTo :: Unit -> Unit -> Unit -> [Unit] #

Show Unit Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

showsPrec :: Int -> Unit -> ShowS #

show :: Unit -> String #

showList :: [Unit] -> ShowS #

Eq Unit Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

(==) :: Unit -> Unit -> Bool #

(/=) :: Unit -> Unit -> Bool #

Lift Unit Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

lift :: Quote m => Unit -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Unit -> Code m Unit #

data UnitExp Source #

An exponentiated unit

Constructors

UnitExp 

Fields

Instances

Instances details
Show Dimension Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Show UnitExp Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Eq Dimension Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Eq UnitExp Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

(==) :: UnitExp -> UnitExp -> Bool #

(/=) :: UnitExp -> UnitExp -> Bool #

Lift UnitExp Source # 
Instance details

Defined in Math.Haskellator.Internal.Units

Methods

lift :: Quote m => UnitExp -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => UnitExp -> Code m UnitExp #

type Dimension = [UnitExp] Source #

A dimension is a list of exponentiated units

divide :: Dimension -> (Dimension, Dimension) -> (Dimension, Dimension) Source #

Splits a list of dimensions into units with positive and units negative exponents