Strictness annotations on type parameters

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Dec 6 16:32:30 EST 2005


On Tue, 2005-12-06 at 16:05 -0500, Mario Blazevic wrote:
>     No container data type can be annotated as strict. That means I have 
> to pepper my code with explicit evaluations to HNF before every 
> writeIORef (reference label):
> 
> newState `seq` writeIORef (reference label) newState

Or it can be written:

writeIORef (reference label) $! newState


($!) is defined in the Prelude by:

f $! x = x `seq` f x


Duncan



More information about the Glasgow-haskell-users mailing list