on master help sign in
Rename Parser.yield, yieldM to fromPure, fromEffect.
7d9256ePranay Sashank
README.md+1−1
@@ -388,7 +388,7 @@ listDir dir =
388main :: IO ()
388main :: IO ()
389main = do
389main = do
390 hSetBuffering stdout LineBuffering
390 hSetBuffering stdout LineBuffering
391− let start = Stream.yield (Left ".")
391+ let start = Stream.fromPure (Left ".")
392 Stream.iterateMapLeftsWith Stream.ahead listDir start
392 Stream.iterateMapLeftsWith Stream.ahead listDir start
393 & Stream.mapM_ print
393 & Stream.mapM_ print
394```
394```
src/Streamly/Internal/Data/Array/Stream/Fold/Foreign.hs+2−2
@@ -206,7 +206,7 @@ rmapM f (Fold p) = Fold $ ParserD.rmapM f p
206--
206--
207{-# INLINE fromPure #-}
207{-# INLINE fromPure #-}
208fromPure :: Monad m => b -> Fold m a b
208fromPure :: Monad m => b -> Fold m a b
209−fromPure = Fold . ParserD.yield
209+fromPure = Fold . ParserD.fromPure
210
210
211-- | A fold that always yields the result of an effectful action without
211-- | A fold that always yields the result of an effectful action without
212-- consuming any input.
212-- consuming any input.
@@ -215,7 +215,7 @@ fromPure = Fold . ParserD.yield
215--
215--
216{-# INLINE fromEffect #-}
216{-# INLINE fromEffect #-}
217fromEffect :: Monad m => m b -> Fold m a b
217fromEffect :: Monad m => m b -> Fold m a b
218−fromEffect = Fold . ParserD.yieldM
218+fromEffect = Fold . ParserD.fromEffect
219
219
220-- | Applies two folds sequentially on the input stream and combines their
220-- | Applies two folds sequentially on the input stream and combines their
221-- results using the supplied function.
221-- results using the supplied function.
src/Streamly/Internal/Data/Binary/Decode.hs+1−1
@@ -47,7 +47,7 @@ import qualified Streamly.Internal.Data.Parser.ParserK.Type as PRK
47--
47--
48{-# INLINE unit #-}
48{-# INLINE unit #-}
49unit :: MonadCatch m => Parser m Word8 ()
49unit :: MonadCatch m => Parser m Word8 ()
50−unit = eqWord8 0 *> PR.yield ()
50+unit = eqWord8 0 *> PR.fromPure ()
51
51
52{-# INLINE word8ToBool #-}
52{-# INLINE word8ToBool #-}
53word8ToBool :: Word8 -> Either String Bool
53word8ToBool :: Word8 -> Either String Bool
src/Streamly/Internal/Data/Parser.hs+12−12
@@ -54,8 +54,8 @@ module Streamly.Internal.Data.Parser
54 -- First order parsers
54 -- First order parsers
55 -- * Accumulators
55 -- * Accumulators
56 , fromFold
56 , fromFold
57− , yield
57+ , fromPure
58− , yieldM
58+ , fromEffect
59 , die
59 , die
60 , dieM
60 , dieM
61
61
@@ -231,28 +231,28 @@ fromFold = K.toParserK . D.fromFold
231-- Terminating but not failing folds
231-- Terminating but not failing folds
232-------------------------------------------------------------------------------
232-------------------------------------------------------------------------------
233--
233--
234−-- This is the dual of stream "yield".
234+-- This is the dual of stream "fromPure".
235--
235--
236-- | A parser that always yields a pure value without consuming any input.
236-- | A parser that always yields a pure value without consuming any input.
237--
237--
238-- /Pre-release/
238-- /Pre-release/
239--
239--
240−{-# INLINE [3] yield #-}
240+{-# INLINE [3] fromPure #-}
241−yield :: MonadCatch m => b -> Parser m a b
241+fromPure :: MonadCatch m => b -> Parser m a b
242−yield = K.toParserK . D.yield
242+fromPure = K.toParserK . D.fromPure
243−{-# RULES "yield fallback to CPS" [2]
243+{-# RULES "fromPure fallback to CPS" [2]
244− forall a. K.toParserK (D.yield a) = K.yield a #-}
244+ forall a. K.toParserK (D.fromPure a) = K.fromPure a #-}
245
245
246−-- This is the dual of stream "yieldM".
246+-- This is the dual of stream "fromEffect".
247--
247--
248-- | A parser that always yields the result of an effectful action without
248-- | A parser that always yields the result of an effectful action without
249-- consuming any input.
249-- consuming any input.
250--
250--
251-- /Pre-release/
251-- /Pre-release/
252--
252--
253−{-# INLINE yieldM #-}
253+{-# INLINE fromEffect #-}
254−yieldM :: MonadCatch m => m b -> Parser m a b
254+fromEffect :: MonadCatch m => m b -> Parser m a b
255−yieldM = K.yieldM -- K.toParserK . D.yieldM
255+fromEffect = K.fromEffect -- K.toParserK . D.fromEffect
256
256
257-- This is the dual of "nil".
257-- This is the dual of "nil".
258--
258--
src/Streamly/Internal/Data/Parser/ParserD.hs+2−2
@@ -21,8 +21,8 @@ module Streamly.Internal.Data.Parser.ParserD
21 -- First order parsers
21 -- First order parsers
22 -- * Accumulators
22 -- * Accumulators
23 , fromFold
23 , fromFold
24− , yield
24+ , fromPure
25− , yieldM
25+ , fromEffect
26 , die
26 , die
27 , dieM
27 , dieM
28
28
src/Streamly/Internal/Data/Parser/ParserD/Type.hs+11−11
@@ -117,8 +117,8 @@ module Streamly.Internal.Data.Parser.ParserD.Type
117 , ParseError (..)
117 , ParseError (..)
118 , rmapM
118 , rmapM
119
119
120− , yield
120+ , fromPure
121− , yieldM
121+ , fromEffect
122 , serialWith
122 , serialWith
123 , split_
123 , split_
124
124
@@ -339,21 +339,21 @@ rmapM f (Parser step initial extract) = Parser step1 initial1 (extract >=> f)
339 IError err -> return $ IError err
339 IError err -> return $ IError err
340 step1 s a = step s a >>= mapMStep f
340 step1 s a = step s a >>= mapMStep f
341
341
342−-- | See 'Streamly.Internal.Data.Parser.yield'.
342+-- | See 'Streamly.Internal.Data.Parser.fromPure'.
343--
343--
344-- /Pre-release/
344-- /Pre-release/
345--
345--
346−{-# INLINE_NORMAL yield #-}
346+{-# INLINE_NORMAL fromPure #-}
347−yield :: Monad m => b -> Parser m a b
347+fromPure :: Monad m => b -> Parser m a b
348−yield b = Parser undefined (pure $ IDone b) undefined
348+fromPure b = Parser undefined (pure $ IDone b) undefined
349
349
350−-- | See 'Streamly.Internal.Data.Parser.yieldM'.
350+-- | See 'Streamly.Internal.Data.Parser.fromEffect'.
351--
351--
352-- /Pre-release/
352-- /Pre-release/
353--
353--
354−{-# INLINE yieldM #-}
354+{-# INLINE fromEffect #-}
355−yieldM :: Monad m => m b -> Parser m a b
355+fromEffect :: Monad m => m b -> Parser m a b
356−yieldM b = Parser undefined (IDone <$> b) undefined
356+fromEffect b = Parser undefined (IDone <$> b) undefined
357
357
358-------------------------------------------------------------------------------
358-------------------------------------------------------------------------------
359-- Sequential applicative
359-- Sequential applicative
@@ -608,7 +608,7 @@ noErrorUnsafeSplit_ (Parser stepL initialL extractL) (Parser stepR initialR extr
608-- | 'Applicative' form of 'serialWith'.
608-- | 'Applicative' form of 'serialWith'.
609instance MonadThrow m => Applicative (Parser m a) where
609instance MonadThrow m => Applicative (Parser m a) where
610 {-# INLINE pure #-}
610 {-# INLINE pure #-}
611− pure = yield
611+ pure = fromPure
612
612
613 {-# INLINE (<*>) #-}
613 {-# INLINE (<*>) #-}
614 (<*>) = serialWith id
614 (<*>) = serialWith id
src/Streamly/Internal/Data/Parser/ParserK/Type.hs+11−11
@@ -21,8 +21,8 @@
21module Streamly.Internal.Data.Parser.ParserK.Type
21module Streamly.Internal.Data.Parser.ParserK.Type
22 (
22 (
23 Parser (..)
23 Parser (..)
24− , yield
24+ , fromPure
25− , yieldM
25+ , fromEffect
26 , die
26 , die
27
27
28 -- * Conversion
28 -- * Conversion
@@ -279,23 +279,23 @@ instance Functor m => Functor (Parser m a) where
279-- Sequential applicative
279-- Sequential applicative
280-------------------------------------------------------------------------------
280-------------------------------------------------------------------------------
281
281
282−-- This is the dual of stream "yield".
282+-- This is the dual of stream "fromPure".
283--
283--
284-- | A parser that always yields a pure value without consuming any input.
284-- | A parser that always yields a pure value without consuming any input.
285--
285--
286-- /Pre-release/
286-- /Pre-release/
287--
287--
288−{-# INLINE yield #-}
288+{-# INLINE fromPure #-}
289−yield :: b -> Parser m a b
289+fromPure :: b -> Parser m a b
290−yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
290+fromPure b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
291
291
292−-- | See 'Streamly.Internal.Data.Parser.yieldM'.
292+-- | See 'Streamly.Internal.Data.Parser.fromEffect'.
293--
293--
294-- /Pre-release/
294-- /Pre-release/
295--
295--
296−{-# INLINE yieldM #-}
296+{-# INLINE fromEffect #-}
297−yieldM :: Monad m => m b -> Parser m a b
297+fromEffect :: Monad m => m b -> Parser m a b
298−yieldM eff = MkParser $ \lo st yieldk -> eff >>= \b -> yieldk st (Done lo b)
298+fromEffect eff = MkParser $ \lo st yieldk -> eff >>= \b -> yieldk st (Done lo b)
299
299
300-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.serialWith'. Note that
300-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.serialWith'. Note that
301-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.serialWith'
301-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.serialWith'
@@ -303,7 +303,7 @@ yieldM eff = MkParser $ \lo st yieldk -> eff >>= \b -> yieldk st (Done lo b)
303--
303--
304instance Monad m => Applicative (Parser m a) where
304instance Monad m => Applicative (Parser m a) where
305 {-# INLINE pure #-}
305 {-# INLINE pure #-}
306− pure = yield
306+ pure = fromPure
307
307
308 {-# INLINE (<*>) #-}
308 {-# INLINE (<*>) #-}
309 (<*>) = ap
309 (<*>) = ap
src/Streamly/Internal/FileSystem/Event/Linux.hs+3−3
@@ -774,7 +774,7 @@ readOneEvent :: Config -> Watch -> Parser IO Word8 Event
774readOneEvent cfg wt@(Watch _ wdMap) = do
774readOneEvent cfg wt@(Watch _ wdMap) = do
775 let headerLen = (sizeOf (undefined :: CInt)) + 12
775 let headerLen = (sizeOf (undefined :: CInt)) + 12
776 arr <- PR.takeEQ headerLen (A.writeN headerLen)
776 arr <- PR.takeEQ headerLen (A.writeN headerLen)
777− (ewd, eflags, cookie, pathLen) <- PR.yieldM $ A.asPtr arr readHeader
777+ (ewd, eflags, cookie, pathLen) <- PR.fromEffect $ A.asPtr arr readHeader
778 -- XXX need the "initial" in parsers to return a step type so that "take 0"
778 -- XXX need the "initial" in parsers to return a step type so that "take 0"
779 -- can return without an input. otherwise if pathLen is 0 we will keep
779 -- can return without an input. otherwise if pathLen is 0 we will keep
780 -- waiting to read one more char before we return this event.
780 -- waiting to read one more char before we return this event.
@@ -792,7 +792,7 @@ readOneEvent cfg wt@(Watch _ wdMap) = do
792 when (remaining /= 0) $ PR.takeEQ remaining FL.drain
792 when (remaining /= 0) $ PR.takeEQ remaining FL.drain
793 return pth
793 return pth
794 else return $ A.fromList []
794 else return $ A.fromList []
795− wdm <- PR.yieldM $ readIORef wdMap
795+ wdm <- PR.fromEffect $ readIORef wdMap
796 let (root, sub) =
796 let (root, sub) =
797 case Map.lookup (fromIntegral ewd) wdm of
797 case Map.lookup (fromIntegral ewd) wdm of
798 Just pair -> pair
798 Just pair -> pair
@@ -805,7 +805,7 @@ readOneEvent cfg wt@(Watch _ wdMap) = do
805 -- Check for "ISDIR" first because it is less likely
805 -- Check for "ISDIR" first because it is less likely
806 isDirCreate = eflags .&. iN_ISDIR /= 0 && eflags .&. iN_CREATE /= 0
806 isDirCreate = eflags .&. iN_ISDIR /= 0 && eflags .&. iN_CREATE /= 0
807 when (watchRec cfg && isDirCreate)
807 when (watchRec cfg && isDirCreate)
808− $ PR.yieldM $ addToWatch cfg wt root sub1
808+ $ PR.fromEffect $ addToWatch cfg wt root sub1
809 -- XXX Handle IN_DELETE, IN_DELETE_SELF, IN_MOVE_SELF, IN_MOVED_FROM,
809 -- XXX Handle IN_DELETE, IN_DELETE_SELF, IN_MOVE_SELF, IN_MOVED_FROM,
810 -- IN_MOVED_TO
810 -- IN_MOVED_TO
811 -- What if a large dir tree gets moved in to our hierarchy? Do we get a
811 -- What if a large dir tree gets moved in to our hierarchy? Do we get a
test/Streamly/Test/Data/Parser.hs+14−14
@@ -61,17 +61,17 @@ fromFold =
61 Right is_equal -> is_equal
61 Right is_equal -> is_equal
62 Left _ -> False
62 Left _ -> False
63
63
64−yield :: Property
64+fromPure :: Property
65−yield =
65+fromPure =
66 forAll (chooseInt (min_value, max_value)) $ \x ->
66 forAll (chooseInt (min_value, max_value)) $ \x ->
67− case S.parse (P.yield x) (S.fromList [1 :: Int]) of
67+ case S.parse (P.fromPure x) (S.fromList [1 :: Int]) of
68 Right r -> r == x
68 Right r -> r == x
69 Left _ -> False
69 Left _ -> False
70
70
71−yieldM :: Property
71+fromEffect :: Property
72−yieldM =
72+fromEffect =
73 forAll (chooseInt (min_value, max_value)) $ \x ->
73 forAll (chooseInt (min_value, max_value)) $ \x ->
74− case S.parse (P.yieldM $ return x) (S.fromList [1 :: Int]) of
74+ case S.parse (P.fromEffect $ return x) (S.fromList [1 :: Int]) of
75 Right r -> r == x
75 Right r -> r == x
76 Left _ -> False
76 Left _ -> False
77
77
@@ -418,13 +418,13 @@ wordBy =
418
418
419-- splitWithFailLeft :: Property
419-- splitWithFailLeft :: Property
420-- splitWithFailLeft =
420-- splitWithFailLeft =
421−-- property (case S.parse (P.serialWith (,) (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
421+-- property (case S.parse (P.serialWith (,) (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
422-- Right _ -> False
422-- Right _ -> False
423-- Left _ -> True)
423-- Left _ -> True)
424
424
425-- splitWithFailRight :: Property
425-- splitWithFailRight :: Property
426-- splitWithFailRight =
426-- splitWithFailRight =
427−-- property (case S.parse (P.serialWith (,) (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
427+-- property (case S.parse (P.serialWith (,) (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
428-- Right _ -> False
428-- Right _ -> False
429-- Left _ -> True)
429-- Left _ -> True)
430
430
@@ -447,13 +447,13 @@ wordBy =
447
447
448-- teeWithFailLeft :: Property
448-- teeWithFailLeft :: Property
449-- teeWithFailLeft =
449-- teeWithFailLeft =
450−-- property (case S.parse (P.teeWith (,) (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
450+-- property (case S.parse (P.teeWith (,) (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
451-- Right _ -> False
451-- Right _ -> False
452-- Left _ -> True)
452-- Left _ -> True)
453
453
454-- teeWithFailRight :: Property
454-- teeWithFailRight :: Property
455-- teeWithFailRight =
455-- teeWithFailRight =
456−-- property (case S.parse (P.teeWith (,) (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
456+-- property (case S.parse (P.teeWith (,) (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
457-- Right _ -> False
457-- Right _ -> False
458-- Left _ -> True)
458-- Left _ -> True)
459
459
@@ -489,13 +489,13 @@ wordBy =
489
489
490-- shortestFailLeft :: Property
490-- shortestFailLeft :: Property
491-- shortestFailLeft =
491-- shortestFailLeft =
492−-- property (case S.parse (P.shortest (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
492+-- property (case S.parse (P.shortest (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
493-- Right r -> r == 1
493-- Right r -> r == 1
494-- Left _ -> False)
494-- Left _ -> False)
495
495
496-- shortestFailRight :: Property
496-- shortestFailRight :: Property
497-- shortestFailRight =
497-- shortestFailRight =
498−-- property (case S.parse (P.shortest (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
498+-- property (case S.parse (P.shortest (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
499-- Right r -> r == 1
499-- Right r -> r == 1
500-- Left _ -> False)
500-- Left _ -> False)
501
501
@@ -705,8 +705,8 @@ main =
705
705
706 describe "test for accumulator" $ do
706 describe "test for accumulator" $ do
707 prop "P.fromFold FL.sum = FL.sum" fromFold
707 prop "P.fromFold FL.sum = FL.sum" fromFold
708− prop "yield value provided" yield
708+ prop "fromPure value provided" fromPure
709− prop "yield monadic value provided" yieldM
709+ prop "fromPure monadic value provided" fromEffect
710 prop "fail err = Left (SomeException (ParseError err))" parserFail
710 prop "fail err = Left (SomeException (ParseError err))" parserFail
711 prop "always fail" die
711 prop "always fail" die
712 prop "always fail but monadic" dieM
712 prop "always fail but monadic" dieM
test/Streamly/Test/Data/Parser/ParserD.hs+16−16
@@ -64,17 +64,17 @@ fromFold =
64 Right is_equal -> is_equal
64 Right is_equal -> is_equal
65 Left _ -> False
65 Left _ -> False
66
66
67−yield :: Property
67+fromPure :: Property
68−yield =
68+fromPure =
69 forAll (chooseInt (min_value, max_value)) $ \x ->
69 forAll (chooseInt (min_value, max_value)) $ \x ->
70− case S.parseD (P.yield x) (S.fromList [1 :: Int]) of
70+ case S.parseD (P.fromPure x) (S.fromList [1 :: Int]) of
71 Right r -> r == x
71 Right r -> r == x
72 Left _ -> False
72 Left _ -> False
73
73
74−yieldM :: Property
74+fromEffect :: Property
75−yieldM =
75+fromEffect =
76 forAll (chooseInt (min_value, max_value)) $ \x ->
76 forAll (chooseInt (min_value, max_value)) $ \x ->
77− case S.parseD (P.yieldM $ return x) (S.fromList [1 :: Int]) of
77+ case S.parseD (P.fromEffect $ return x) (S.fromList [1 :: Int]) of
78 Right r -> r == x
78 Right r -> r == x
79 Left _ -> False
79 Left _ -> False
80
80
@@ -396,13 +396,13 @@ serialWith =
396
396
397splitWithFailLeft :: Property
397splitWithFailLeft :: Property
398splitWithFailLeft =
398splitWithFailLeft =
399− property (case S.parseD (P.serialWith (,) (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
399+ property (case S.parseD (P.serialWith (,) (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
400 Right _ -> False
400 Right _ -> False
401 Left _ -> True)
401 Left _ -> True)
402
402
403splitWithFailRight :: Property
403splitWithFailRight :: Property
404splitWithFailRight =
404splitWithFailRight =
405− property (case S.parseD (P.serialWith (,) (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
405+ property (case S.parseD (P.serialWith (,) (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
406 Right _ -> False
406 Right _ -> False
407 Left _ -> True)
407 Left _ -> True)
408
408
@@ -425,13 +425,13 @@ teeWithPass =
425
425
426teeWithFailLeft :: Property
426teeWithFailLeft :: Property
427teeWithFailLeft =
427teeWithFailLeft =
428− property (case S.parseD (P.teeWith (,) (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
428+ property (case S.parseD (P.teeWith (,) (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
429 Right _ -> False
429 Right _ -> False
430 Left _ -> True)
430 Left _ -> True)
431
431
432teeWithFailRight :: Property
432teeWithFailRight :: Property
433teeWithFailRight =
433teeWithFailRight =
434− property (case S.parseD (P.teeWith (,) (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
434+ property (case S.parseD (P.teeWith (,) (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
435 Right _ -> False
435 Right _ -> False
436 Left _ -> True)
436 Left _ -> True)
437
437
@@ -456,13 +456,13 @@ shortestPass =
456
456
457shortestPassLeft :: Property
457shortestPassLeft :: Property
458shortestPassLeft =
458shortestPassLeft =
459− property (case S.parseD (P.shortest (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
459+ property (case S.parseD (P.shortest (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
460 Right r -> r == 1
460 Right r -> r == 1
461 Left _ -> False)
461 Left _ -> False)
462
462
463shortestPassRight :: Property
463shortestPassRight :: Property
464shortestPassRight =
464shortestPassRight =
465− property (case S.parseD (P.shortest (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
465+ property (case S.parseD (P.shortest (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
466 Right r -> r == 1
466 Right r -> r == 1
467 Left _ -> False)
467 Left _ -> False)
468
468
@@ -490,13 +490,13 @@ longestPass =
490
490
491longestPassLeft :: Property
491longestPassLeft :: Property
492longestPassLeft =
492longestPassLeft =
493− property (case S.parseD (P.shortest (P.die "die") (P.yield (1 :: Int))) (S.fromList [1 :: Int]) of
493+ property (case S.parseD (P.shortest (P.die "die") (P.fromPure (1 :: Int))) (S.fromList [1 :: Int]) of
494 Right r -> r == 1
494 Right r -> r == 1
495 Left _ -> False)
495 Left _ -> False)
496
496
497longestPassRight :: Property
497longestPassRight :: Property
498longestPassRight =
498longestPassRight =
499− property (case S.parseD (P.shortest (P.yield (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
499+ property (case S.parseD (P.shortest (P.fromPure (1 :: Int)) (P.die "die")) (S.fromList [1 :: Int]) of
500 Right r -> r == 1
500 Right r -> r == 1
501 Left _ -> False)
501 Left _ -> False)
502
502
@@ -723,8 +723,8 @@ main =
723
723
724 describe "test for accumulator" $ do
724 describe "test for accumulator" $ do
725 prop "P.fromFold FL.sum = FL.sum" fromFold
725 prop "P.fromFold FL.sum = FL.sum" fromFold
726− prop "yield value provided" yield
726+ prop "fromPure value provided" fromPure
727− prop "yield monadic value provided" yieldM
727+ prop "fromPure monadic value provided" fromEffect
728 prop "always fail" die
728 prop "always fail" die
729 prop "always fail but monadic" dieM
729 prop "always fail but monadic" dieM
730
730