Safe Haskell | Safe-Infered |
---|
Utilities for working with TypeSum
s.
- empty :: Kind n -> TypeSum n
- singleton :: Ord n => Kind n -> Type n -> TypeSum n
- elem :: (Eq n, Ord n) => Type n -> TypeSum n -> Bool
- insert :: Ord n => Type n -> TypeSum n -> TypeSum n
- delete :: Ord n => Type n -> TypeSum n -> TypeSum n
- union :: Ord n => TypeSum n -> TypeSum n -> TypeSum n
- unions :: Ord n => Kind n -> [TypeSum n] -> TypeSum n
- difference :: Ord n => TypeSum n -> TypeSum n -> TypeSum n
- kindOfSum :: TypeSum n -> Kind n
- toList :: TypeSum n -> [Type n]
- fromList :: Ord n => Kind n -> [Type n] -> TypeSum n
- hashTyCon :: TyCon n -> Maybe TyConHash
- hashTyConRange :: (TyConHash, TyConHash)
- unhashTyCon :: TyConHash -> TyCon n
- takeSumArrayElem :: Type n -> Maybe (TyConHash, TypeSumVarCon n)
- makeSumArrayElem :: TyConHash -> TypeSumVarCon n -> Type n
Documentation
singleton :: Ord n => Kind n -> Type n -> TypeSum nSource
Construct a type sum containing a single element.
elem :: (Eq n, Ord n) => Type n -> TypeSum n -> BoolSource
Check whether an element is a member of a sum.
- Returns True when the first argument is $0 or !0.
- Returns False when the first argument is another sum.
- May return False if the first argument is miskinded but still alpha-equivalent to some component of the sum.
difference :: Ord n => TypeSum n -> TypeSum n -> TypeSum nSource
Delete all members of the second sum from the first one.
hashTyConRange :: (TyConHash, TyConHash)Source
The range of hashes that can be produced by hashTyCon
.
unhashTyCon :: TyConHash -> TyCon nSource
takeSumArrayElem :: Type n -> Maybe (TyConHash, TypeSumVarCon n)Source
If this type can be put in one of our arrays then split it into the hash and the argument.
makeSumArrayElem :: TyConHash -> TypeSumVarCon n -> Type nSource
Inverse of takeSumArrayElem
.