From 2c78a06addd36c44c1392760d41e1d10d23b5a4e Mon Sep 17 00:00:00 2001 From: Daniel Casanueva Date: Sat, 4 Jun 2022 17:51:55 +0200 Subject: [PATCH] Generalize type of Servant.Types.SourceT.source to any foldable. --- servant/src/Servant/Types/SourceT.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servant/src/Servant/Types/SourceT.hs b/servant/src/Servant/Types/SourceT.hs index 84cb4b6a..d66405c5 100644 --- a/servant/src/Servant/Types/SourceT.hs +++ b/servant/src/Servant/Types/SourceT.hs @@ -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.