Skip to content

Commit c104438

Browse files
authored
Merge pull request #103 from konsumlamm/dollar-bang-bang
Fix documentation for `$!!`
2 parents c321fed + 4a0ed60 commit c104438

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
@@ -215,14 +215,19 @@ infixr 0 `deepseq`
215215
deepseq :: NFData a => a -> b -> b
216216
deepseq a b = rnf a `seq` b
217217

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

225-
-- | a variant of 'deepseq' that is useful in some circumstances:
230+
-- | A variant of 'deepseq' that is useful in some circumstances:
226231
--
227232
-- > force x = x `deepseq` x
228233
--

0 commit comments

Comments
 (0)