strictly-1.0.0.0: Combinators for strictifying functions

Safe HaskellSafe-Inferred

Control.Strictly

Contents

Description

Turn a function lazy in its arguments into a function strict in its arguments.

It should be noted that this does nothing to change the internals of a function. If the function is lazy on the inside, these combinators cannot fix that. They only change the external entry point to the function: the indicated number of arguments will be forced before attempting to evaluate the function.

For finer control over evaluation strategies, use the parallel package.

Synopsis

Weak Head Normal Form

strictly1 :: (a -> b) -> a -> bSource

Equivalent to $!

strictly1 is idempotent.

 strictly1 (strictly1 f) x ≡ strictly1 f x

strictly2 :: (a -> b -> c) -> a -> b -> cSource

strictly3 :: (a -> b -> c -> d) -> a -> b -> c -> dSource

Normal Form

veryStrictly1 :: NFData a => (a -> b) -> a -> bSource

Equivalent to $!!

veryStrictly1 is idempotent.

 veryStrictly1 (veryStrictly1 f) x ≡ veryStrictly1 f x

veryStrictly2 :: (NFData a, NFData b) => (a -> b -> c) -> a -> b -> cSource

veryStrictly3 :: (NFData a, NFData b, NFData c) => (a -> b -> c -> d) -> a -> b -> c -> dSource