I am reading category theory for programmers about functions type.
He says:
Notice that curry is the factorizer for the universal construction of the function object. This is especially apparent if it’s rewritten in this form:
factorizer :: ((a, b)->c) -> (a->(b->c)) factorizer g = \a -> (\b -> g (a, b))(As a reminder: A factorizer produces the factorizing function from a candidate.)
What is a 'factorizer' and 'universal construction'?
What is he trying to explain about currying?
The idea of a universal construction and a factorizer was introduced in earlier chapters (in particular in the one about the product and coproduct).
In short, a universal construction compares all possible candidates that share a given property. Here, the candidate is an object z with a morphism g going from (z × a) to b. The best such candidate is an object denoted by (a=>b) with the morphism called eval.
The universal property is that for any candidate z together with g there is a unique morphism h that factorizes the diagram given in the picture. A factorizer is a recipe for obtaining this h given z and g, in a particular category. In Haskell, g is a function ((a, z)-> b) and h is a function (z -> (a -> b)). So, up to renaming of variables and symmetry of the product, the factorizer has exactly the signature of curry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With