Proposal: Add an analogue of $! to deepseq

Daniel Fischer daniel.is.fischer at googlemail.com
Fri Jul 1 10:08:44 CEST 2011


On Friday 01 July 2011, 09:55:40, Ivan Lazar Miljenovic wrote:
> 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 $!!

I think that would be useful.

> 
> 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

Could also be useful.

> 
> Discussion time: 2 weeks

+1



More information about the Libraries mailing list