deepseq icon indicating copy to clipboard operation
deepseq copied to clipboard

Optimizing negations

Open treeowl opened this issue 3 years ago • 0 comments

If we have f :: b -> Void and g :: a -> b, we can get f . g :: a -> Void. But if we do this recursively, we'll get closures of increasing size. Would it make sense to offer something like this?

compNeg :: NFData a => (b -> Void) -> (a -> b) -> a -> Void
compNeg _ _ a = a `deepseq` error "Weird NFData instance or something"

treeowl avatar Oct 07 '22 19:10 treeowl