Copyright | (C) 2017 ATS Advanced Telematic Systems GmbH Li-yao Xia |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Li-yao Xia <lysxia@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Template Haskell functions to derive common type classes for testing with quickcheck-state-machine.
- deriveTestClasses :: Name -> Q [Dec]
- deriveHClasses :: Name -> Q [Dec]
- deriveHFunctor :: Name -> Q [Dec]
- deriveHFoldable :: Name -> Q [Dec]
- deriveHTraversable :: Name -> Q [Dec]
- deriveConstructors :: Name -> Q [Dec]
- deriveShows :: Name -> Q [Dec]
- deriveShow :: Name -> Q [Dec]
- deriveShowUntyped :: Name -> Q [Dec]
- mkShrinker :: Name -> Q Exp
Special classes for Action
types
deriveTestClasses :: Name -> Q [Dec] Source #
Derive instances of
HFunctor
,
HFoldable
,
HTraversable
,
Constructor
.
Components
deriveHClasses :: Name -> Q [Dec] Source #
Derive HFunctor
, HFoldable
, HTraversable
.
deriveHFunctor :: Name -> Q [Dec] Source #
deriveHFunctor
''Action ===> instanceHFunctor
Action where ...
deriveHFoldable :: Name -> Q [Dec] Source #
deriveHFoldable
''Action ===> instanceHFoldable
Action where ...
deriveHTraversable :: Name -> Q [Dec] Source #
deriveHTraversable
''Action ===> instanceHTraversable
Action where ...
deriveConstructors :: Name -> Q [Dec] Source #
deriveConstructors
''Action ===> instanceConstructors
Action where ...
Show
deriveShows :: Name -> Q [Dec] Source #
Given a name ''Action
,
derive Show
for (Action v a)
and (
.
See Untyped
Action)deriveShow
and deriveShowUntyped
.
deriveShow :: Name -> Q [Dec] Source #
deriveShow
''Action ===> deriving instanceShow1
v =>Show
(Action v a)@.
deriveShowUntyped :: Name -> Q [Dec] Source #
deriveShowUntyped
''Action ===> deriving instanceShow
(Untyped
Action)
Shrink
mkShrinker :: Name -> Q Exp Source #
$(
creates a generic shrinker of type mkShrinker
''Action)(Action v a -> [Action v a])
which ignores Reference
fields.