units-2.0: A domain-specific type system for dimensional analysis

Copyright(C) 2013 Richard Eisenberg
LicenseBSD-style (see LICENSE)
MaintainerRichard Eisenberg (eir@cis.upenn.edu)
Stabilityexperimental
Portabilitynon-portable
Safe HaskellUnsafe
LanguageHaskell2010

Data.Metrology.Unsafe

Contents

Description

This module exports the constructor of the Qu type. This allows you to write code that takes creates and reads quantities at will, which may lead to dimension unsafety. Use at your peril.

Synopsis

The Dim type

newtype Qu a lcsu n Source

Qu adds a dimensional annotation to its numerical value type n. This is the representation for all quantities.

Constructors

Qu n 

Instances

Eq n => Eq (Qu ([] (Factor *)) l n) 
Floating n => Floating (Qu ([] (Factor *)) l n) 
Fractional n => Fractional (Qu ([] (Factor *)) l n) 
Num n => Num (Qu ([] (Factor *)) l n) 
Ord n => Ord (Qu ([] (Factor *)) l n) 
Real n => Real (Qu ([] (Factor *)) l n) 
RealFloat n => RealFloat (Qu ([] (Factor *)) l n) 
RealFrac n => RealFrac (Qu ([] (Factor *)) l n) 
(ShowUnitFactor (LookupList dims lcsu), Show n) => Show (Qu dims lcsu n) 
type (Qu d l n) %^ z = Qu ((@*) d z) l n 
type (Qu d1 l n) %/ (Qu d2 l n) = Qu ((@-) d1 d2) l n 
type (Qu d1 l n) %* (Qu d2 l n) = Qu ((@+) d1 d2) l n