Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (eir@cis.upenn.edu) |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module defines a few set-like operations on type-level lists. It may be applicable beyond the units package.
- type family SetEqual as bs :: Constraint
- type family Subset as bs :: Constraint
- type family Elem a bs :: Constraint
Documentation
type family SetEqual as bs :: Constraint Source
Are two lists equal, when considered as sets?
type family Subset as bs :: Constraint Source
Is one list a subset of the other?
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?
Elem a (a : bs) = (() :: Constraint) | |
Elem a (b : bs) = a `Elem` bs |