Skip to content

Commit 4a0ed60

Browse files
authored
Fix documentation for $!!
1 parent 21c6bdf commit 4a0ed60

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Control/DeepSeq.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,19 @@ infixr 0 `deepseq`
214214
deepseq :: NFData a => a -> b -> b
215215
deepseq a b = rnf a `seq` b
216216

217-
-- | the deep analogue of '$!'. In the expression @f $!! x@, @x@ is
218-
-- fully evaluated before the function @f@ is applied to it.
217+
-- | The deep analogue of '$!'. @f $!! x@ fully evaluates @x@
218+
-- before returning @f x@.
219+
--
220+
-- There is no guarantee about the ordering of evaluation.
221+
-- @f x@ may be evaluated before @x@ is fully evaluated.
222+
-- To impose an actual order on evaluation, use 'pseq' from
223+
-- "Control.Parallel" in the @parallel@ package.
219224
--
220225
-- @since 1.2.0.0
221226
($!!) :: (NFData a) => (a -> b) -> a -> b
222227
f $!! x = x `deepseq` f x
223228

224-
-- | a variant of 'deepseq' that is useful in some circumstances:
229+
-- | A variant of 'deepseq' that is useful in some circumstances:
225230
--
226231
-- > force x = x `deepseq` x
227232
--

0 commit comments

Comments
 (0)