@@ -540,7 +540,10 @@ parTraversable strat = evalTraversable (rparWith strat)
540540-- Strategies for lists
541541
542542-- | Evaluate each element of a list according to the given strategy.
543- -- Equivalent to 'evalTraversable' at the list type.
543+ -- Equivalent to 'evalTraversable' at the list type.
544+ --
545+ -- __Warning:__ This strategy evaluates the spine of the list
546+ -- and thus does not work on infinite lists.
544547evalList :: Strategy a -> Strategy [a ]
545548evalList = evalTraversable
546549-- Alternative explicitly recursive definition:
@@ -550,14 +553,17 @@ evalList = evalTraversable
550553-- return (x':xs')
551554
552555-- | Evaluate each element of a list in parallel according to given strategy.
553- -- Equivalent to 'parTraversable' at the list type.
556+ -- Equivalent to 'parTraversable' at the list type.
557+ --
558+ -- __Warning:__ This strategy evaluates the spine of the list
559+ -- and thus does not work on infinite lists.
554560parList :: Strategy a -> Strategy [a ]
555561parList = parTraversable
556562-- Alternative definition via evalList:
557563-- parList strat = evalList (rparWith strat)
558564
559565-- | @'evaListSplitAt' n stratPref stratSuff@ evaluates the prefix
560- -- (of length @n@) of a list according to @stratPref@ and its the suffix
566+ -- (of length @n@) of a list according to @stratPref@ and the suffix
561567-- according to @stratSuff@.
562568evalListSplitAt :: Int -> Strategy [a ] -> Strategy [a ] -> Strategy [a ]
563569evalListSplitAt n stratPref stratSuff xs
@@ -598,6 +604,9 @@ parListNth n strat = evalListNth n (rparWith strat)
598604--
599605-- This function may be replaced by a more
600606-- generic clustering infrastructure in the future.
607+ --
608+ -- __Warning:__ This strategy evaluates the spine of the list
609+ -- and thus does not work on infinite lists.
601610parListChunk :: Int -> Strategy a -> Strategy [a ]
602611parListChunk n strat
603612 | n <= 1 = parList strat
@@ -630,6 +639,8 @@ evalChunk strat = \end ->
630639--
631640-- > parMap strat f = withStrategy (parList strat) . map f
632641--
642+ -- __Warning:__ This function evaluates the spine of the list
643+ -- and thus does not work on infinite lists.
633644parMap :: Strategy b -> (a -> b ) -> [a ] -> [b ]
634645parMap strat f = (`using` parList strat) . map f
635646
0 commit comments