Safe Haskell | None |
---|---|
Language | Haskell2010 |
Core of the TypeSpec abstractions. Import to add custom instances.
- data TypeSpec expectation where
- Valid :: Try (EvalExpectation expectation) ~ expectation => TypeSpec expectation
- Invalid :: DontTry (EvalExpectation expectation) => TypeSpec expectation
- type family EvalExpectation (expectation :: k) :: Result k
- class PrettyTypeSpec t where
- prettyIndentation :: Int
- nest' :: Doc -> Doc
- sentence :: String -> Doc -> Doc
Core Data Type
data TypeSpec expectation where Source #
A type specification.
Valid :: Try (EvalExpectation expectation) ~ expectation => TypeSpec expectation | Expect the given expectations to hold. If the compiler does not reject it - the expectation seem plausible. |
Invalid :: DontTry (EvalExpectation expectation) => TypeSpec expectation | Expect the given expectations to **NOT** hold. If the compiler does not reject it - the expectation seem indeed implausible. |
PrettyTypeSpec k t => Show (TypeSpec k t) Source # | |
Expectations
type family EvalExpectation (expectation :: k) :: Result k Source #
An open family of type level expectation evaluators, that return either ()
or an ErrorMessage
.
type EvalExpectation Type (ShouldBeFalse t t1) Source # | |
type EvalExpectation Type (ShouldBeTrue t t1) Source # | |
type EvalExpectation Type (It expectation message expectation1) Source # | |
type EvalExpectation Type (ShouldNotBe expected actual expected1 actual1) Source # | |
type EvalExpectation Type (ShouldBe t t1 expected actual) Source # | |
type EvalExpectation Type (ButNot Type actual (ShouldBe t t1 expected actual1) other) Source # | |
type EvalExpectation [k] ([] k) Source # | |
type EvalExpectation [a] ((:) a expectation rest) Source # | |
type EvalExpectation * ((-/-) a1 a expectation expectations) Source # | |
type EvalExpectation (a1, a) ((,) a1 a a2 b) Source # | |
Pretty Printing Support
class PrettyTypeSpec t where Source #
prettyTypeSpec :: proxy t -> Doc Source #
PrettyTypeSpec Type (ShouldBeFalse expectation a) Source # | |
PrettyTypeSpec Type (ShouldBeTrue expectation a) Source # | |
(KnownSymbol msg, PrettyTypeSpec expectation x) => PrettyTypeSpec Type (It expectation msg x) Source # | |
(Showtype expected a, Showtype actual b) => PrettyTypeSpec Type (ShouldNotBe expected actual a b) Source # | |
PrettyTypeSpec Type (ShouldBe expected actual a b) Source # | |
((~) Type a (ShouldBe k k1 a0 a1), Showtype k a0, Showtype k1 a1, Showtype actual b) => PrettyTypeSpec Type (ButNot Type actual a b) Source # | |
PrettyTypeSpec [k] ([] k) Source # | |
(PrettyTypeSpec a expectation, PrettyTypeSpec [a] rest) => PrettyTypeSpec [a] ((:) a expectation rest) Source # | |
(PrettyTypeSpec k expectation1, PrettyTypeSpec k1 expectation2) => PrettyTypeSpec * ((-/-) k k1 expectation1 expectation2) Source # | Pretty Printing Instance. |
(PrettyTypeSpec k expectation1, PrettyTypeSpec k1 expectation2) => PrettyTypeSpec (k, k1) ((,) k k1 expectation1 expectation2) Source # | |