That's simple Tom.<br>Imagine the factorial function for Int written as a paramorphism:<br><br>type instance F Int = Either One<br><br>instance (Mu Int) where<br> inn (Left _) = 0<br> inn (Right n) = succ n<br> out 0 = Left ()<br>
out n = Right (pred n)<br><br>instance Functor (F Int) where<br> fmap _ (Left ()) = Left ()<br> fmap f (Right n) = Right (f n)<br><br>fact :: Int -> Int<br>fact = para (const 1 \/ (uncurry (*)) . (id >< succ))<br>
<br>If we consider that the paramorphism is implemented as an hylomorphism, then an intermediate virtual type (d in the hylo definition) [Int]<br><br>If you test the constraints for d = [Int], a = Int and c = Int<br><br>F d c ~ F a (c,a)<br>
<br>F d a = F [Int] Int = Either One (Int,Int)<br>F a (c,a) = F Int (Int,Int) = Either One (Int,Int)<br><br>F d a ~ F a (a,a)<br><br>F d a = F a (a,a) -- pure substitution of the above case<br><br>Hope this helps.<br>Thanks again for you patience,<br>
hugo<br><br><br>