Skip to content

Commit

Permalink
Added "Your mental model of optics - shattered"
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Nov 8, 2018
1 parent 4fd694f commit b5b9ae6
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 77 deletions.
81 changes: 44 additions & 37 deletions docs/mental-optics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
still left mysterious, please <a href="https://gitter.im/calmm-js/chat">let me know</a> and
I&#39;ll try to add some additional notes.</p>
</aside></script></section><section data-markdown><script type="text/template">
## Outline

* Part I - Motivation
* Part II - Basics 💡
* Part III - Examples 😮
* Part IV - Exercises 💪
* Part V - Wrap up 🎓
</script></section><section data-markdown><script type="text/template">
## Part I - Motivation
</script></section><section data-markdown><script type="text/template">
> My mental model of lenses is that of a path into a data structure. A
Expand Down Expand Up @@ -96,20 +88,12 @@
<!-- .element: class="fragment" -->Optics are a *game changer*

<aside class="notes"><p>We&#39;ll actually not be going too much into theory in the presentation, but
the other claims will definitely be addressed.</p>
</aside></script></section><section data-markdown><script type="text/template">
## Disclaimer

* This will not be a theory lesson
* This isn't a complete treatment
* You will not know everything after this training

<aside class="notes"><p>When presenting a topic, I have a tendency to try to mention a lot of
related details for completeness. I have decided leave such things out of this
presentation. So, if you find that e.g. I didn&#39;t mention some related
generalization or list full set of related concepts, then most likely that is
because I made a decision to leave that out due to desire to keep the
presentation shorter.</p>
the other claims will definitely be addressed. When presenting a topic, I have
a tendency to try to mention a lot of related details for completeness. I have
decided leave such things out of this presentation. So, if you find that e.g. I
didn&#39;t mention some related generalization or list full set of related concepts,
then most likely that is because I made a decision to leave that out due to
desire to keep the presentation shorter.</p>
</aside></script></section><section data-markdown><script type="text/template">
## Part II - Basics
</script></section><section data-markdown><script type="text/template">
Expand All @@ -119,8 +103,8 @@
> structure in some particular way and then put it back together.

*<span class="fragment">Traversals,</span> <span class="fragment">Lenses,</span> <span class="fragment">Isomorphisms,</span> <span class="fragment">..., Getters</span>*

<!-- .element: class="fragment" -->[Taking apart an
</script></section><section data-markdown><script type="text/template">
[Taking apart an
object](https://calmm-js.github.io/partial.lenses/playground.html#PTAEBUEMGsEsDsDmpIAdICcAuL6gPYBGAVgKYDGOCoAtgK4A2WsqDpoAJrAGbekal4OAO6QAngGcAUFPL54EnB0hZIoALygA3gA8AXKADkkQwBpQYg4cJnQALyvlDAXxkgAMgDpEpLAApDHVtlVQBKKQ9PCV8AoPNDAEEk4JVIcMiBGnwAN1JYlLCI4C8ffy9oUjFSDnMQtKKvaP8AbXLK6vMABi6AXXiAMQB5QYL6yLkGNko-L0EsDFhSCVrU9OLvGK80VjEEss85haXzLwFcjGjQlcLIpr9Wz22GXf3DxeXQU9Jzy-iTPqMAHVIBIALRxTirBqeCZTfYVSTXMbrGgIWD0GgzTwIj51NZeYj4BABUG2NqIyE3FH4LjcMRYnHmABKMPk5BUAX6+HwpKulORXlhFH22UgDDox35+M8WVp9K8ovFkpZcng7P8hgAQpheUjpaUsVwJISEP4ERoAHygc3qW1GIKgAD8RkImEMoCs3G5hj5eOhBq8qAw+FQEny8TEPr1-s2niDIYkAFEdORSKgNRDDJHfVDIgGZdsEIg-H4dOYxOY7KFLaBmrpy5XnOZmmXtBX7M4ej0c1TPH2gA)
&mdash; [with
narrative](https://calmm-js.github.io/partial.lenses/playground.html#PTAEBUEMGsEsDsDmpIAdICcAuL6gPYBGAVgKYDGOCoAtgK4A2WsqDpoAJrAGbekal4OAO6QAngGcAUFPL54EnB0hZIoALygA3gA8AXKADkkQwBpQYg4cJnQALyvlDAXxkgAMgDpEpLAApDHVtlVQBKUAjIqOiY2OiQUABBcnJSCQlQVAx8VH4sMVAsAAtsukQilFA2BSkPTwlfAKDzQ0S24JVIcLieuISAZV9M7NzsAuLS8srq6TqBGnwAN1ImjrDejZ6EgCVSBeXhnLzxkvwyirUZ2uAvH38vaFIxUg5zEK7Nz6iEgDVYUmEBBIFBwkAymAw4gI3EykFgGAyEzOU0geFgEnw1y8DX8AG0Hk8XuYAAwkgC6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^^^^^^^^
```

```js
R.map(R.map(R.toUpper), data)
L.modify([L.elems, L.values], R.toUpper, data)
// ^^^^^^^^^^^^^^^^^^^
```

Optic composition is constant when the selection of elements is constant.
Expand All @@ -222,12 +208,14 @@
R.join('-', R.chain(R.values, data))
L.join('-', [L.elems, L.values], data)
// ^^^^^^^^^^^^^^^^^^^
```

```js
R.sum(R.chain(R.values, data))
L.sum([L.elems, L.values], data)
// ^^^^^^^^^^^^^^^^^^^
```

No intermediate collection is computed by traversals.
Expand All @@ -250,6 +238,21 @@

The above is incomplete!
</script></section><section data-markdown><script type="text/template">
## To manipulate data

1. <!-- .element: class="fragment" -->Compose an optic to select the desired elements
* <!-- .element: class="fragment" -->Write some draft optic
* <!-- .element: class="fragment" -->Test by querying with it
```js
L.collect L.get
```
* <!-- .element: class="fragment" -->Iterate
2. <!-- .element: class="fragment" --> Apply the operation you wanted
```
L.modify L.set L.remove L.sum L.foldl L.sum ...
```
3. <!-- .element: class="fragment" -->Go home and spend time with family
</script></section><section data-markdown><script type="text/template">
### express so much with so little

<img src="rivero.png">
Expand Down Expand Up @@ -480,11 +483,9 @@
keys](https://calmm-js.github.io/partial.lenses/playground.html#MYewdgzgLgBAJgQygmBeGBvAUAUwB4IC2AlmEseAMIhw4BcMA5AMoBMADAIwAcjANLgKFqtBowASASX5ZEATxH0YYAK4AbNQIjAAFiBBqAcisIAjHACcGndlwEqADoig4AKsUJLGHHgFp2AJz+ATIAjio40BSQDADaAESc8Xww8azJqQDM8QC6WlAqtGBQEHFYGABmxBbQhkSRYpIQIDJqCLX1DPEACupQUMTJWBAQYGJcE5z+Npwy0IU4xcZmltYC4ZED4KUwsRhwxBAObXLL5lapSSnaIBY4AGoIahEMmQC+KfuHxwinJuddbLXUB3R7PJQAFjeeWGIJwzBMDAA7B9ylUalA6p4dowALIqaAIVrtTGdVK4hAAa0pCAsCCGIzGTHYHFZ-lZcwKRUx-1WMFY6wiUW2cS+RxOZz5aQyN1BTxeMChnwO4t+kou8SBMF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Oak5CbHMZgOSCkUBKTEA4nSPA9DnFaO0fxmj5D70PssPxYRO5Nw3o-Lx9l5COTTP4Y+Ng8CmFUAbKgGii4oF3qk7RB4TiBPjvo0AyxhZUACZFaI8xiDmRsv4gp+loDFM2KUOgztbFx3zjpfuy85gLD8bKJgPsFh7FQdrUEB8LCDMPqrF40ygndiUcAaO1ThlFIwLo8ebTIHtARMQBMCcC7LEuUoMZnB8H+HgHwc6xkZDZIFskc5vI2BAuiu80Z1z76dMhakByHyYV6LaQ4HAriThz0ec8k45xXkpNEY0yAMismN2MJEVgysthPIyEwFAsJdDc1BHzDBzj0U9WgCwR+ndBCqioK4RsRjkxOU0CwHwDA6BCtWf3U55zoqhXKT4qpNSWj1MJYfLB78MDEJsOKvAdBCSMBeUQh+wrDVMDYTcmgdyw5bFgLlBINAfCcHgEOO4WlohBBZZJAYxQXFmLNhg7AsgSiygwWPGgExJ7TyeTgPCmhRgWRkmEyxETMBoHgEgEQPVBB4AMEYZQagqAqB6TpUJ4TFLvEDabJCBIOD7AGVQVQjrGjWXKZCAuKJo35oPDke5Rieo4uQIIVA3dvl2rWEgOg4bKhV1pT6ixVjIkDw0Lgac6BQgxrCE5LgjAFLsE4GgayCBtC6EHjpMOCLebsmrTYIAA)
&mdash;
[structurally](https://calmm-js.github.io/partial.lenses/playground.html#MYewdgzgLgBAJgQygmBeGBvAUAUwB4IC2AlmEseAMIhw4BcMA5AMoBMADAIwAcjANLgKFqtBowASASX5ZEATxH0YYAK4AbNQIjAAFiBBqAcisIAjHACcGndlwEqADoig4AKsUJLGHHgFp2AJz+ATIAjio40BSQDADaAESc8Xww8azJqQDM8QC6WlAqtGBQEHFYGABmxBbQhkSRYpIQIDJqCLX1DPEACupQUMTJWBAQYGJcE5z+Npwy0IU4xcZmltYC4ZED4KUwsRhwxBAObXLL5lapSSnaIBY4AGoIahEMmQC+KfuHxwinJuddbLXUB3R7PJQAFjeeWGIJwzBMDAA7B9ylUalA6p4dowALIqaAIVrtTGdVK4hAAa0pCAsCCGIzGTHYHFZ-lZcwKRUx-1WMFY6wiUW2cS+RxOZz5aQyN1BTxeMChnwO4t+kou8SBMFlD3lSlY0K0cIRhAYADZUTksG8sFhQJBYA47gBzOkHMDOpogNAwAAyADoHMRgJSABTYApQSmkKAgSmWZBifBEUjkKg0HAySkgLzJ4QZmQgCAIMTyRRZkDqFSqTwWEBibR6AzqmS0gBuRZczzA3QAJ8Q273CL3exZe2JHM43B5MwJKXIIHJCHJKRAcFAxBthZAK-G2kgyox5tyIDIA7S6XJQ1gA0GQ+HcAUwDON0x0R1sXMVJTqx5iGI2g-WcsGzPd2hrSx6yYY9Fh5FYLBkNsnhIQkkIAQQsDtoBwZ44kYLcth3FJzwsS9Q1vYMwwwGB50XZccRVH4-ng-gYCDbD1wbOEwQiRgYDeABKASYXYlxiCKE1CBLaDjRMRhrQErBFKtQTbQDZ111DJ0cFdBB3U9ZoUmcBABKAA)
&mdash; [structurally](https://calmm-js.github.io/partial.lenses/playground.html#MYewdgzgLgBAJgQygmBeGBvAUAUwB4IC2AlmEseAMIhw4BcMA5AMoBMADAIwAcjANLgKFqtBowASASX5ZEATxH0YYAK4AbNQIjAAFiBBqAcisIAjHACcGndlwEqADoig4AKsUJLGHHgFp2AJz+ATIAjio40BSQDADaAESc8Xww8azJqQDM8QC6WlAqtGBQEHFYGABmxBbQhkSRYpIQIDJqCLX1DPEACupQUMTJWBAQYGJcE5z+Npwy0IU4xcZmltYC4ZED4KUwsRhwxBAObXLL5lapSSnaIBY4AGoIahEMmQC+KfuHxwinJuddbLXUB3R7PJQAFjeeWGIJwzBMDAA7B9ylUalA6p4dowALIqaAIVrtTGdVK4hAAa0pCAsCCGIzGTHYHFZ-lZcwKRUx-1WMFY6wiUW2cS+RxOZz5aQyN1BTxeMChnwO4t+kou8SBMFlD3lSlY0K0cIRhAYADZUTksG8sFhQJBYA47gBzOkHMDOpogNAwAAyADoHMRgJSABTYApQSmkKAgSmWZBifBEUjkKg0HAySkgLzJ4QZmQgCAIMTyRRZkDqFSqTwWEBibR6AzqmS0gBuRZczzA3QAJ8Q273CL3exZe2JHM43B5MwJKXIIHJCHJKRAcFAxBthZAK-G2kgyox5tyIDIA7S6XJQ1gA0GQ+HcAUwDON0x0R1sXMVJTqx5iGI2g-WcsGzPd2hrSx6yYY9Fh5FYLBkNsnhIQkkIAQQsDtoBwZ44kYLcth3FJzwsS9Q1vYMwwwGB50XZccRVH4-ng-gYCDbD1wbOEwQiRgYDeABKASYXYlxiCKE1CBLaDjRMRhrQErBFKtQTbQDZ111DJ0cFdBB3U9ZoUmcBABKAA)

* [Parsing and pretty-printing
combinators](https://calmm-js.github.io/partial.lenses/playground.html#PTAEAsBdIBwLhAd2QOgJYDsBmB7ATgLYCGkaA1igK4ZoC0xeARpXgOYoAmApsAH55cM3ADbBqMIngDOPAFCyQoAJIZIXPDAFq8oXDsDdwLQDGRYUcrDKU0LVt37Dx0+cuH8ozgxTIoTNs1cPgC8oAAUggBuADSgXAAemgCUoEEAfKAA3rJSiGiQRuBh8ZookACeMFzJWSYyoADkwkQE9XCyWiwYoBGmlFwp6X7qAZChADIoMqPFeCgSeM0xPZZcMZGJawmzjDgcZYmytf31RDAwre2Bnb6qw1rhGNGxWyhY1ImhQxr3kZslkqxEgcjg0BFgLh08F1IgBtGYoDDNLgAXVAAF9ZBiFGAAMI4AiMTAkfDWPSgAAKkikmFYoCIQgpWnKtHJeD8NNAuUghXmpFMvik+PwMHAaCkBGsTncnm8oEFLCMXAA8lgUqAAEroLAAUWEMlCsk1YtCAGVIGyMICooaUAIYE1FaFgDCAD4AHTdGTRoUSMLdyIAegASADUACoAPwoZHAVgxeoeoMAMnqG1kE1YgVC9XleEVqdkB0OMp8ACscJg1aFhOApDE8LXkmlMrI0Krq7WUMJBKxuaAk0nQA2pF2e9zqsWvD5gqAa1IYXPR5a+7RQABGVEhoe1mEABmRrfbwDdiBPLphAdCyLdoRdgCTCYClLjeUKQIFDq5Q2e10Bb+oNX9tykTFLkga450A4cQMnW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FQOENG2gvfxPjWDLyBLIIywjnZ4zghXKuWw4F120XFcBsouGMA4EQHOpQ-ahDUV-NJWiiwgHkBmLMuT8nxn0HEUAd5QD6HJi0ppj0Xrn0SEAA)
* [Parsing and pretty-printing combinators](https://calmm-js.github.io/partial.lenses/playground.html#PTAEAsBdIBwLhAd2QOgJYDsBmB7ATgLYCGkaA1igK4ZoC0xeARpXgOYoAmApsAH55cM3ADbBqMIngDOPAFCyQoAJIZIXPDAFq8oXDsDdwLQDGRYUcrDKU0LVt37Dx0+cuH8ozgxTIoTNs1cPgC8oAAUggBuADSgXAAemgCUoEEAfKAA3rJSiGiQRuBh8ZookACeMFzJWSYyoADkwkQE9XCyWiwYoBGmlFwp6X7qAZChADIoMqPFeCgSeM0xPZZcMZGJawmzjDgcZYmytf31RDAwre2Bnb6qw1rhGNGxWyhY1ImhQxr3kZslkqxEgcjg0BFgLh08F1IgBtGYoDDNLgAXVAAF9ZBiFGAAMI4AiMTAkfDWPSgAAKkikmFYoCIQgpWnKtHJeD8NNAuUghXmpFMvik+PwMHAaCkBGsTncnm8oEFLCMXAA8lgUqAAEroLAAUWEMlCsk1YtCAGVIGyMICooaUAIYE1FaFgDCAD4AHTdGTRoUSMLdyIAegASADUACoAPwoZHAVgxeoeoMAMnqG1kE1YgVC9XleEVqdkB0OMp8ACscJg1aFhOApDE8LXkmlMrI0Krq7WUMJBKxuaAk0nQA2pF2e9zqsWvD5gqAa1IYXPR5a+7RQABGVEhoe1mEABmRrfbwDdiBPLphAdCyLdoRdgCTCYClLjeUKQIFDq5Q2e10Bb+oNX9tykTFLkga450A4cQMnWVIBwMhBDVCRoHULpmxqEsPzVdUuFYbUElCAADS8gwyXNFRVUJkO0DBEjRRIPSkMNQlCCM4BQd1aLDRIg0Ig5IS6CYxRwA1rGbUIjSkU1zRpGIpGSAcwjEj8UHiLgjFCeTkgjUAYXnAAmZE5JhDdUTgUBqG4LBMC4Dg0xgAYwkk0IAEE8AWMoYhgbTQHLTAqJMozQBgP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dCSYAmCmLQbM2HLkVIBmAUMat2mALoBfFVXE8ALDLpzRS5VkVZl6-BJgBWKrJELO3UgDYdw+RzW5HMAOyu99hqkABz+dh6qhsZRWNTg0DAAZvRIUGwEYADmAEoArvQsEGgwADIAdAj0aUxgSAQAboUAFFjlALYIAA6dGZlNIGgAfJg4ZWMgYe4GAhij4wKdEBGKigCUVNjtXT1ZTU3AEAIgq0MjY2UTgrrhghCmmJcHK+utZQBeBJ0A6gRQNGQtLbdXp7ToyBYQE6oYbYDBgmBzMrABYIeRQJYwRaqdTnZGYjFwgTnRYqIyrLDkxQbV65LJMEC5ToAIQAnk1yrRCMBmhgAOSLXkCAAMAl53F5VJgYqIvNWL3KqKYCBZEHZZQ6wN2-QhUJhiMuWIE+pRaIxWLWlIpsXKmRYUBamwqUDSbU6UAAoo0mCyAKqdJrJVLpLJ5AqQqhUrCIZAUoA)
Expand Down Expand Up @@ -521,14 +522,11 @@
</script></section><section data-markdown><script type="text/template">
## Limitation: Single data structure

* <!-- .element: class="fragment" -->But perhaps there are ways...
* <!-- .element: class="fragment" -->Laziness? (Works in read direction.)
* <!-- .element: class="fragment" -->Some sort of cross product or join
combinator?
* <!-- .element: class="fragment" -->Or use isomorphism combinators to massage
data?
* <!-- .element: class="fragment" -->Extend optics to address multiple data
structures at once?
* But perhaps there are ways...
* Laziness? (Works in read direction.)
* Some sort of cross product or join combinator?
* Or use isomorphism combinators to massage data?
* Extend optics to address multiple data structures at once?
* <!-- .element: class="fragment" -->Somewhat open question (to me)
</script></section><section data-markdown><script type="text/template">
## When might I recommend to use optics?
Expand Down Expand Up @@ -595,7 +593,16 @@

<!-- .element: class="fragment" -->Ask questions and request feedback.
</script></section><section data-markdown><script type="text/template">
## What about Partial Lenses?
## What about [Partial Lenses](https://github.com/calmm-js/partial.lenses/)?

<small>(The lib used in these slides.)</small>

* Fairly comprehensive API
* Lots of interactive documentation
* High test coverage
* Been in production use since beginning
* Optimized to some degree
* Engineered for DCE

<!-- .element: class="fragment" -->I **_can't_** recommend it, because...

Expand Down
Loading

0 comments on commit b5b9ae6

Please sign in to comment.