Merge pull request #173 from OutThisLife/patch-1

use object init shorthand for prod types
This commit is contained in:
hemanth.hm 2017-11-08 13:59:23 +05:30 committed by GitHub
commit 5fb5b468d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -843,7 +843,7 @@ A **product** type combines types together in a way you're probably more familia
```js
// point :: (Number, Number) -> {x: Number, y: Number}
const point = (x, y) => ({x: x, y: y})
const point = (x, y) => ({ x, y })
```
It's called a product because the total possible values of the data structure is the product of the different values. Many languages have a tuple type which is the simplest formulation of a product type.