Suppose I wanted a function of type [[a]] -> [[b]] -> [[(a, b)]]
. I'm sure I could figure something out, but chances are, it wouldn't be as clean as, for example, zipWith zip
, which also has that type.
Entering this type signature into Hoogle gives me a few functions that fill this role, but they come from the leancheck
and extrapolate
packages, which I wouldn't want to drag into my project without a good reason.
Given that you can compute function composition through equational reasoning, I am wondering if there is an inverse to this process: is there a way that I could “factorize” a complex type signature and reduce it down to its simplest function composition?