Copyright | (c) Artem Chirkin |
---|---|
License | BSD3 |
Maintainer | chirkin@arch.ethz.ch |
Safe Haskell | None |
Language | Haskell2010 |
Construct type-level evidence at runtime
Synopsis
- data Evidence :: Constraint -> Type where
- withEvidence :: Evidence a -> (a => r) -> r
- sumEvs :: Evidence a -> Evidence b -> Evidence (a, b)
- (+!+) :: Evidence a -> Evidence b -> Evidence (a, b)
- data Evidence' :: (k -> Constraint) -> k -> Type where
- toEvidence :: Evidence' c a -> Evidence (c a)
- toEvidence' :: Evidence (c a) -> Evidence' c a
Documentation
data Evidence :: Constraint -> Type where Source #
Bring an instance of certain class or constaint satisfaction evidence into scope.
withEvidence :: Evidence a -> (a => r) -> r Source #
Pattern match agains evidence to get constraints info
data Evidence' :: (k -> Constraint) -> k -> Type where Source #
Same as Evidence
, but allows to separate constraint function from
the type it is applied to.
toEvidence :: Evidence' c a -> Evidence (c a) Source #
toEvidence' :: Evidence (c a) -> Evidence' c a Source #