Merge 7c69652f86
into ad25e98e19
This commit is contained in:
commit
7bb7eb96e1
|
@ -0,0 +1,2 @@
|
|||
synopsis: Generalize type of Servant.Types.SourceT.source to any foldable.
|
||||
prs: 1593
|
|
@ -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.
|
||||
|
@ -269,7 +269,7 @@ mapMaybeStep p = go where
|
|||
|
||||
-- | Run action for each value in the 'SourceT'.
|
||||
--
|
||||
-- >>> foreach fail print (source "abc")
|
||||
-- >>> foreach fail print $ source ("abc" :: String)
|
||||
-- 'a'
|
||||
-- 'b'
|
||||
-- 'c'
|
||||
|
|
Loading…
Reference in New Issue