File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ data GenMode
110110-- | A `Gen` monad wrapper that allows different generation modes and different
111111-- failure types.
112112newtype GenT m a = GenT { runGenT :: GenMode -> [NonEmpty String ] -> Gen (m a )}
113- deriving (Functor )
113+
114+ instance Functor f => Functor (GenT f ) where
115+ fmap f (GenT k) = GenT $ \ mode msgs -> fmap (fmap f) (k mode msgs)
114116
115117instance Monad m => Applicative (GenT m ) where
116118 pure a = GenT (\ _ _ -> pure @ Gen (pure @ m a))
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ genFromSpecT (simplifySpec -> spec) = case spec of
128128
129129-- | A version of `genFromSpecT` that simply errors if the generator fails
130130genFromSpec :: forall a . (HasCallStack , HasSpec a ) => Specification a -> Gen a
131- genFromSpec spec = either ( error . ( ' \n ' : ) . catMessages) id <$> catchGen (genFromSpecT @ a @ GE spec)
131+ genFromSpec spec = genFromGenT (genFromSpecT @ a @ GE spec)
132132
133133-- | A version of `genFromSpecT` that takes a seed and a size and gives you a result
134134genFromSpecWithSeed ::
You can’t perform that action at this time.
0 commit comments