deepseq
deepseq copied to clipboard
Optimizing negations
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"