Skip to content

Commit 4cd9112

Browse files
jethrolarsonhemanth
authored andcommitted
Added links to ramda's awesome type signature documentation and a SO describing Hindley-Milner (#85)
Adjusted wording of the PS
1 parent da2cca1 commit 4cd9112

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

readme.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ TODO
552552

553553
## Type Signatures
554554

555-
Often functions will include comments that indicate the types of their arguments and return types.
555+
Often functions in JavaScript will include comments that indicate the types of their arguments and return values.
556556

557557
There's quite a bit of variance across the community but they often follow the following patterns:
558558

@@ -573,13 +573,18 @@ If a function accepts another function as an argument it is wrapped in parenthes
573573
const call = (f) => (x) => f(x)
574574
```
575575

576-
The letters `a`, `b`, `c`, `d` are used to signify that the argument can be of any type. For this `map` it takes a function that transforms a value of some type `a` into another type `b`, an array of values of type `a`, and returns an array of values of type `b`.
576+
The letters `a`, `b`, `c`, `d` are used to signify that the argument can be of any type. The following version of `map` takes a function that transforms a value of some type `a` into another type `b`, an array of values of type `a`, and returns an array of values of type `b`.
577577

578578
```js
579579
// map :: (a -> b) -> [a] -> [b]
580580
const map = (f) => (list) => list.map(f)
581581
```
582582

583+
### Further reading
584+
* [Ramda's type signatures](https://github.com/ramda/ramda/wiki/Type-Signatures)
585+
* [Mostly Adaquate Guide](https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch7.html#whats-your-type)
586+
* [What is Hindley-Milner?](http://stackoverflow.com/a/399392/22425) on Stack Overflow
587+
583588
## Union type
584589
A union type is the combination of two types together into another one.
585590

@@ -663,4 +668,4 @@ getNestedPrice({item: {price: 9.99}}); // Some(9.99)
663668

664669
---
665670

666-
__P.S:__ Without the wonderful [contributions](https://github.com/hemanth/functional-programming-jargon/graphs/contributors) this repo would be meaningless!
671+
__P.S:__ This repo is successful due to the wonderful [contributions](https://github.com/hemanth/functional-programming-jargon/graphs/contributors)!

0 commit comments

Comments
 (0)