Home

From Category Theory for Programmers - Series 1

Category Theory 8.1 Category Theory 8.1 - Function objects, exponentials

h :: z -> (a -> b)
-- | which is the same as
g :: (z,a) -> b
curry :: ((a,b) -> c) -> (a -> (b -> c))
curry f = λ a -> (λ b -> f(a,b))
-- | corresponding uncurry
uncurry :: (a -> (b -> c) -> ((a,b) -> c)
-- | (f a) returns a function, which then calls b
uncurry f = λ(a,b) -> (f a) b

(part 2 - Category Theory 8.2 - Type algebra, Curry-Howard-Lambek isomorphism)