| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.TypeSpec.Core
Description
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.
Constructors
| 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. |
Instances
| 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.
Instances
| 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 actual1 expected1) Source # | |
| type EvalExpectation Type (ShouldBe t t1 actual expected) Source # | |
| type EvalExpectation Type (ButNot shouldntBe Type (ShouldBe t t1 actual expected) other) Source # | |
| type EvalExpectation [k] ([] k) Source # | |
| type EvalExpectation [a] ((:) a expectation rest) Source # | |
| type EvalExpectation * ((-/-) a a1 expectation expectations) Source # | |
| type EvalExpectation (a, a1) ((,) a a1 a2 b) Source # | |
Pretty Printing Support
class PrettyTypeSpec t where Source #
Minimal complete definition
Methods
prettyTypeSpec :: proxy t -> Doc Source #
Instances
| 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 expected actual a b) Source # | |
| PrettyTypeSpec Type (ShouldBe expected actual a b) Source # | |
| (~) Type a (ShouldBe expected actual a0 a1) => PrettyTypeSpec Type (ButNot shouldntBe Type a b) Source # | |
| PrettyTypeSpec [k] ([] k) Source # | |
| (PrettyTypeSpec a expectation, PrettyTypeSpec [a] rest) => PrettyTypeSpec [a] ((:) a expectation rest) Source # | |
| (PrettyTypeSpec k1 expectation1, PrettyTypeSpec k expectation2) => PrettyTypeSpec * ((-/-) k k1 expectation1 expectation2) Source # | Pretty Printing Instance. |
| (PrettyTypeSpec k1 expectation1, PrettyTypeSpec k expectation2) => PrettyTypeSpec (k1, k) ((,) k1 k expectation1 expectation2) Source # | |