What does `Forky (a > b) means in type declaration?
This is from some exercise:
(<*>) :: Forky (a > b) > Forky a > Forky b
where Forky is defined as
data Forky a = Tip a  Branch (Forky a) (Forky a)
deriving (Eq, Show)
Usually, I see (a > b)
as a function in the type declaration. But what does Forky (a > b)
means?
3 answers

a > b
is a type like any other. Substituting it into theForky
declaration means that the first argument to your<*>
operator will be either aTip f
(wheref :: a > b
) or aBranch
consisting of twoForky (a > b)
.Forky (a > b)
is just like aForky Int
, except instead of containing integers at the leaves, it contains functions. 
a > b
is still a function type; here, the type constructorForky
is applied to it to get another type. SinceForky a
is basically a type of binary trees containinga
values,Forky (a > b)
is a tree containing functions.Note the similarities:
data Forky a = Tip a  Branch (Forky a) (Forky a) data Tree a = Leaf a  Node (Tree a) (Tree a)

This is a list of three functions
funcs :: [Int > Int] funcs = [ abs, \x > 2*x+1, (`mod` 16) ]
Here's a function that maybe returns a function:
adder :: Int > Maybe (Int > Int) adder n  n > 0 = Just (\m > n + m)  otherwise = Nothing
Here's a function that takes a maybe function as an argument:
applyMay :: Maybe (a > a) > a > a applyMay Nothing x = x applyMay (Just f) x = f x