Proposal: Add an analogue of $! to deepseq

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Jul 1 09:55:40 CEST 2011


I propose we add a operator - tentatively labelled $!! (and which
Hayoo reports isn't currently exported by a Hackage package) - as a
deepseq analogue $! to the deepseq library:

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

infixr 0 $!!

As a sub-proposal, I also propose that we add a "force" function (the
name of which also seems to be unused) to make it easier to test
forcing of values:

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

Discussion time: 2 weeks

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Libraries mailing list