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
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 actual expected actual1 expected1) Source # | |
type EvalExpectation Type (ShouldBe t1 t actual expected) Source # | |
type EvalExpectation Type (ButNot Type shouldntBe (ShouldBe t1 t actual expected) 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 # | |
PrettyTypeSpec Type (ShouldNotBe actual expected a b) Source # | |
PrettyTypeSpec Type (ShouldBe actual expected a b) Source # | |
(~) Type a (ShouldBe actual expected a0 a1) => PrettyTypeSpec Type (ButNot Type shouldntBe 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 # | |