Generalize type of Servant.Types.SourceT.source to any foldable.

This commit is contained in:
Daniel Casanueva 2022-06-04 17:51:55 +02:00
parent 1fba9dc604
commit 2c78a06add

View File

@ -212,7 +212,7 @@ instance (QC.Arbitrary a, Monad m) => QC.Arbitrary (StepT m a) where
-- >>> source "foo" :: SourceT Identity Char
-- fromStepT (Effect (Identity (Yield 'f' (Yield 'o' (Yield 'o' Stop)))))
--
source :: [a] -> SourceT m a
source :: Foldable f => f a -> SourceT m a
source = fromStepT . foldr Yield Stop
-- | Get the answers.