I have this lovely fixana
function here that performs about 5 times faster than her sister ana
. (i have a criterion
report to back me on this)
ana alg = Fix . fmap (ana alg) . alg
fixana alg = fix $ \f -> Fix . fmap f . alg
Can I express their cousin cata
in the same fashion?
cata f = f . fmap (cata f) . unFix
It seems to me that I cannot, but I have been humbled by my S.O. fellows quite a few times in the past.
fixcata f = fix $ \g -> f . fmap g . unFix
? – Lupulin