Skip to content

Commit

Permalink
Merge pull request #49 from boek/add_first_and_second_link_to_toc
Browse files Browse the repository at this point in the history
Added the `first` and `second` entry to the ToC.
  • Loading branch information
robrix committed May 30, 2016
2 parents 00e9aaf + c3e7c85 commit a744069
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Notably, this framework does not provide any new types, or any functions which o
- [`&&&`](#-)
- [`unit`](#unit)
- [`swap`](#swap)
- [`first` and `second`](#first-and-second)
- [Documentation](#documentation)
- [Integration](#integration)

Expand Down Expand Up @@ -135,7 +136,7 @@ map([1, 2, 3], flip(-) <| 1) // => [0, 1, 2]
```swift
let (x: Int?, y: Int?) = (2, 2)
(x &&& y).map(+) // => .Some(4)
```
```


## `unit`
Expand All @@ -158,7 +159,7 @@ map(enumerate("hello"), swap) // => [(h, 0), (e, 1), (l, 2), (l, 3), (o, 4)]

## `first` and `second`

Getting one value from a tuple is a common operation that can be expressed with `first` and `second` functions. Operators provide first and second values of two-elements tuple accordingly.
Getting one value from a tuple is a common operation that can be expressed with `first` and `second` functions. Operators provide first and second values of two-elements tuple accordingly.

```swift
[(0,0), (5, 1), (9, 2)].map(second) // => [0, 1, 2]
Expand Down

0 comments on commit a744069

Please sign in to comment.