I have stumbled upon lots of exercises that give you a function and ask for you to deduce the type of each one.
I have the following example. Please note this is not homework that I need to get done. I have the answer to this specific example and provide it below. Maybe someone can help me out in learning how to reason this kind of exercises.
The function:
h1 f g x y = f (g x y) x
The supposed type:
h1 :: (a -> b -> c) -> (b -> d -> a) -> b -> d -> c
Thanks!
I added 27 exercises here without solutions.
Some of them have solutions included here.
However, it is possible to know the type by using the GHCi command :t