Opened 6 years ago

Closed 6 years ago

#5323 closed feature request (fixed)

Add ($!!) and force to deepseq

Reported by: ivanm Owned by: simonmar
Priority: high Milestone: 7.4.1
Component: libraries (other) Version: 7.0.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

For the related discussion on libraries@, please see http://www.haskell.org/pipermail/libraries/2011-July/016540.html

The result of the discussion was that $!! should be added to deepseq:

($!!) :: (NFData a) => (a -> b) ->a -> b
f $!! x = x `deepseq` f x

infixr 0 $!!

Also, that force should be added but with suitable documentation to indicate possible ways in which it may behave other than as you'd expect:

force :: (NFData a) => a -> a
force x = x `deepseq` x

Change History (4)

comment:1 Changed 6 years ago by igloo

Milestone: 7.4.1
Priority: normalhigh
Status: newpatch

comment:2 Changed 6 years ago by simonmar

Owner: set to simonmar

comment:3 Changed 6 years ago by simonmar

Done.

comment:4 Changed 6 years ago by simonmar

Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.