Hacker News new | past | comments | ask | show | jobs | submit login

> According to currying, 'a -> 'b -> 'c is interchangeable with 'a * 'b -> 'c. (The fancy math word for this interchangeability is "isomorphism.")

I thought isomorphism was when a function was reversible. I didn't think it had anything to do with currying.




It means there are two functions going between them that witness the isomorphism.

The witnesses in Haskell are the higher-order functions (they transform functions) `{,un}curry`:

    curry :: ((a, b) -> c) -> (a -> b -> c)
  uncurry :: (a -> b -> c) -> ((a, b) -> c)


Isomorphism is not about currying. When I mentioned isomorphism, I was referring to the interchangeability in general, and the currying relationship is just an example of an isomorphism. In category theory notation:

Hom(A * B, C) ~ Hom(A, C ^ B)

This is one of the laws of a Cartesian closed category. The simply typed lambda calculus with products is the internal language of a Cartesian-closed category.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: