It looks like you're new here. If you want to get involved, click one of these buttons!
Consider the functor F:
data F a = Nil | Cons Int a deriving Functor
We define the recursive type:
type ListInt = Fix F
isEven :: Int -> Bool take an integer to
True if it is even, and
False otherwise. Here is an F-algebra.
hello :: F Bool -> Bool
hello Nil = False
hello Cons n a = isEven n || a
What is the induced catamorphism
cata hello :: List Int -> Bool?
(b) Implement the function
product :: ListInt -> Int that takes a list of integers and returns their product.