4 ms·
As someone who's only spent about an hour reading an intro to Haskell (and none reading about OCaml), I was able to mostly get the gist of what was being said.
by _bxg1 7y ago
As someone who's only spent about an hour reading an intro to Haskell (and none reading about OCaml), I was able to mostly get the gist of what was being said. Not completely. I had to look up the * operator (effectively a comma between arguments, as opposed to a currying arrow), but I would consider the article to have been useful, even if it could've been more useful.
- TheAsprngHacker 7y agoThe OCaml type 'a * 'b is the equivalent of the Haskell type (a, b). This type is known as the Cartesian product type, and it's written with a multiplication symbol in type theory (hence the asterisk in OCaml syntax). The product type is the type of pairs. It's definition is x : A y : B -------------- (x, y) : A * B meaning that if x has type A and y has type B, then (x, y) has type A * B. - Product type on Wikipedia: https://en.wikipedia.org/wiki/Product_type https://en.wikipedia.org/wiki/Product_type - Product type on the nLab (which is a math-heavy resource): https://ncatlab.org/nlab/show/product+type https://ncatlab.org/nlab/show/product+type