Skip to content

Commit b9e4f8e

Browse files
Arnaud BaillyUlfNorell
andauthored
Putback MonadTrans instance for postcondition (#57)
* Putback MonadTrans instance for postcondition GHC's automatic derivation for PostconditionM's MonadTrans instance introduces a redundant Monad constraint. In order to avoid that, we do the derivation manually. * Update quickcheck-dynamic/src/Test/QuickCheck/StateModel.hs Co-authored-by: Ulf Norell <ulf.norell@gmail.com> * Remove unneeded import --------- Co-authored-by: Ulf Norell <ulf.norell@gmail.com>
1 parent 5a5314b commit b9e4f8e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

quickcheck-dynamic/src/Test/QuickCheck/StateModel.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ type instance Realized Identity a = a
166166
newtype PostconditionM m a = PostconditionM {runPost :: WriterT (Endo Property, Endo Property) m a}
167167
deriving (Functor, Applicative, Monad)
168168

169+
instance MonadTrans PostconditionM where
170+
lift = PostconditionM . lift
171+
169172
-- | Apply the property transformation to the property after evaluating
170173
-- the postcondition. Useful for collecting statistics while avoiding
171174
-- duplication between `monitoring` and `postcondition`.

0 commit comments

Comments
 (0)