Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (rae@cs.brynmawr.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.
Synopsis
- type family SetEqual (as :: [k]) (bs :: [k]) :: Constraint where ...
- type family Subset (as :: [k]) (bs :: [k]) :: Constraint where ...
- type family Elem (a :: k) (bs :: [k]) :: Constraint where ...
Documentation
type family SetEqual (as :: [k]) (bs :: [k]) :: Constraint where ... Source #
Are two lists equal, when considered as sets?
type family Subset (as :: [k]) (bs :: [k]) :: Constraint where ... 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 :: k) (bs :: [k]) :: Constraint where ... Source #
Is an element contained in a list?
Elem a (a ': bs) = () :: Constraint | |
Elem a (b ': bs) = a `Elem` bs |