A first-order function type is already exponential.
A sum type has as many possible values as the sum of its cases. E.g. `A of bool | B of bool` has 2+2=4 values. Similarly for product types and exponential types. E.g. the type bool -> bool has 2^2=4 values (id, not, const true, const false) if you don't think about side effects.
f False = Nothing
f False = Just True
f False = Just False
f True = Nothing
f True = Just True
f True = Just False
Those are 6. What would be the other 3? or should it actually be a*b=6?
EDIT: Nevermind, I counted wrong. Here are the 9:
f x = case x of
True -> Nothing
False -> Nothing
f x = case x of
True -> Nothing
False -> Just False
f x = case x of
True -> Nothing
False -> Just True
f x = case x of
True -> Just False
False -> Nothing
f x = case x of
True -> Just False
False -> Just False
f x = case x of
True -> Just False
False -> Just True
f x = case x of
True -> Just True
False -> Nothing
f x = case x of
True -> Just True
False -> Just False
f x = case x of
True -> Just True
False -> Just True
A sum type has as many possible values as the sum of its cases. E.g. `A of bool | B of bool` has 2+2=4 values. Similarly for product types and exponential types. E.g. the type bool -> bool has 2^2=4 values (id, not, const true, const false) if you don't think about side effects.