Question: What algebraic operation does the function type (A) -> B
correspond to? Try explicitly enumerating all the values of some small cases like (Bool) -> Bool
, (Unit) -> Bool
, (Bool) -> Three
and (Three) -> Bool
to get some intuition.
Suggestion: Rather than list all possible unique input/output pairs, try defining every unique function for a given signature.
Answer: B ** A.
Bool ** Bool = 2 ** 2 = 4:
func f(_ b: Bool) -> Bool { return true }
func f(_ b: Bool) -> Bool { return false }