Skip to content

Commit c7e5d92

Browse files
authored
Merge pull request #94 from marick/master
Added explanatory text to landing page
2 parents 53d14a3 + f3bc732 commit c7e5d92

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,26 @@
66
[![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-lightgrey.svg)](http://github.com/garyb)
77
[![Maintainer: thomashoneyman](https://img.shields.io/badge/maintainer-thomashoneyman-lightgrey.svg)](http://github.com/thomashoneyman)
88

9-
Pure profunctor lenses.
9+
Pure profunctor lenses. A mechanism for updating, viewing, and setting
10+
values within nested data structures. As in:
11+
12+
```purescript
13+
> structure = Tuple (Tuple (Tuple "hi!" 3) 2) 1
14+
15+
> import Data.Lens
16+
> _leftmost = _1 <<< _1 <<< _1
17+
18+
> view _leftmost structure
19+
"hi!"
20+
21+
> set _leftmost "Bye!" structure
22+
(Tuple (Tuple (Tuple "Bye!" 3) 2) 1)
23+
24+
> over _leftmost String.toUpper structure
25+
(Tuple (Tuple (Tuple "HI!" 3) 2) 1)
26+
27+
```
28+
1029

1130
## Installation
1231

@@ -20,6 +39,8 @@ Module documentation is [published on Pursuit](http://pursuit.purescript.org/pac
2039

2140
You can find examples in the [tests](test/Main.purs) and the [examples](examples/README.md) directory.
2241

42+
There is an [ebook](https://leanpub.com/lenses).
43+
2344
## Contributing
2445

2546
Read the [contribution guidelines](https://github.com/purescript-contrib/purescript-profunctor-lenses/blob/master/.github/contributing.md) to get started and see helpful related resources.

0 commit comments

Comments
 (0)