units-2.4: 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 HaskellNone
LanguageHaskell2010

Data.Metrology.Set

Description

This module defines a few set-like operations on type-level lists. It may be applicable beyond the units package.

Synopsis

Documentation

type family SetEqual as bs :: Constraint Source

Are two lists equal, when considered as sets?

Equations

SetEqual as bs = (Subset as bs, Subset bs as) 

type family Subset as bs :: Constraint Source

Is one list a subset of the other?

Equations

Subset `[]` bs = (() :: Constraint) 
Subset (a : as) bs = (a `Elem` bs, as `Subset` bs) 

type family Elem a bs :: Constraint Source

Is an element contained in a list?

Equations

Elem a (a : bs) = (() :: Constraint) 
Elem a (b : bs) = a `Elem` bs