Safe Haskell | None |
---|---|
Language | Haskell2010 |
Result type used in constraints inside TypeSpec
to propagate type errors.
- type Result = Either ErrorMessage
- type family Try (e :: Result k) :: k where ...
- type family DontTry (e :: Result r) :: Constraint where ...
- type FAILED = Left
- type OK = Right
- type family PrependToError (message :: ErrorMessage) (result :: Result a) :: Result a where ...
Documentation
type Result = Either ErrorMessage Source #
When a type level expectation is tested, it might be that compound
expectations fail. In order to have a small, precise error message, the type
level assertion results are made to have kind Result
.
type family DontTry (e :: Result r) :: Constraint where ... Source #
type family PrependToError (message :: ErrorMessage) (result :: Result a) :: Result a where ... Source #
PrependToError message (OK x) = OK x | |
PrependToError message (FAILED otherMessage) = FAILED (message :<>: otherMessage) |