- |Factorial as a hylomorphism on lists.
anacataFactorial :: Integer -> Integer
anacataFactorial = cataList (1 `maybe` uncurry (*)) . anaList coalg
    where
        coalg 0 = Nothing
        coalg n = Just (n, pred n)

-- |Same, but with explicit appeal to hylo.

anacataFactorial :: Integer -> Integer
anacataFactorial = cataList (1 `maybe` uncurry (*)) . anaList coalg
    where
        coalg 0 = Nothing
        coalg n = Just (n, pred n)

-- |Same, but with explicit appeal to hylo.
anacataFactorial = cataList (1 `maybe` uncurry (*)) . anaList coalg
    where
        coalg 0 = Nothing
        coalg n = Just (n, pred n)

-- |Same, but with explicit appeal to hylo.