Skip to content

Commit d0d80ef

Browse files
author
Steve Krouse
committed
small frp essay changes
1 parent 2188ee9 commit d0d80ef

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

drafts/frp.md

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
title: FRP
43
---
@@ -38,7 +37,7 @@ Most programming languages are not modularly comprehensible in such a linear fas
3837

3938
The lack of modular comprehensibility slows down the time it takes a programmer to make a change to an unfamiliar project. This is particularly relevant in open-source software, because developers have limited time to contribute. It's also particularly relevant with front-end code, which is notoriously difficult to follow. Have you ever wanted to make a small bug-fix or improvement to an open-source project, but gave up after a few hours of failing to understand how the code works?
4039

41-
## 2.2 Data dependencies
40+
### 2.2 Data dependencies
4241

4342
Most code is not modularly comprehensible because the way data dependencies between modules are organized.
4443

@@ -174,10 +173,7 @@ Let's contrast the Elm Architecture with a framework that allows higher-order an
174173

175174
#### Reflex Button
176175

177-
```haskell
178-
clickEvents <- intButton clicksCount
179-
clicksCount <- foldDyn (\accumulator currentValue -> accumulator + 1) 0 clickEvents
180-
```
176+
<script src="https://gist.github.com/stevekrouse/dd5adf44e0994bb8665161e0aefed5b6.js"></script>
181177

182178
First look at `intButton clicksCount`. This is where the button is created with the number of clicks as it's text.
183179

@@ -191,19 +187,7 @@ But even if cyclic FRP is possible, is it desirable? In fact, it may seem like t
191187

192188
Here's the same program in Elm:
193189

194-
```elm
195-
-- model
196-
count = 0
197-
198-
--reducer
199-
update msg count =
200-
case msg of
201-
Increment ->
202-
count + 1
203-
204-
-- view
205-
view count = intButton [ onClick Increment ] count
206-
```
190+
<script src="https://gist.github.com/stevekrouse/0e07c0da9803b7386612fa6eb2dc8275.js"></script>
207191

208192
Yes there's less coupling. But is that always a good thing? No, there is such a thing as too little coupling.
209193

@@ -234,15 +218,19 @@ TODO
234218

235219
## Acknowledgements
236220

237-
Thank you Jonathan Edwards for you continued mentorship.
221+
Thank you Jonathan Edwards for your continued mentorship.
238222

239223
## References
240224

241-
[1] - [Reactive MVC and The Virtual DOM](https://web.archive.org/web/20180530055638/https://futurice.com/blog/reactive-mvc-and-the-virtual-dom)
242-
[2] - [CycleJS Guide: Why CSS selectors?](https://cycle.js.org/model-view-intent.html#model-view-intent-what-mvc-is-really-about-why-css-selectors)
243-
[3] - [Accidentally Concurrent](https://youtu.be/DfLvDFxcAIA?t=27m32s)
244-
[4] - [A Human-Readable Interactive Representation of a Code Library](http://glench.github.io/fuzzyset.js/ui/)
245-
[5] - [Walid Maalej, Rebecca Tiarks, Tobias Roehm, and Rainer Koschke. 2014. On the Comprehension of Program Comprehension](https://dl.acm.org/citation.cfm?id=2622669)
225+
[1] - Andre Staltz. [Reactive MVC and The Virtual DOM](https://web.archive.org/web/20180530055638/https://futurice.com/blog/reactive-mvc-and-the-virtual-dom)
226+
227+
[2] - Andre Staltz. [CycleJS Guide: Why CSS selectors?](https://cycle.js.org/model-view-intent.html#model-view-intent-what-mvc-is-really-about-why-css-selectors)
228+
229+
[3] - Ryan Trinkle. [Accidentally Concurrent](https://youtu.be/DfLvDFxcAIA?t=27m32s)
230+
231+
[4] - Glen Chiacchieri. [A Human-Readable Interactive Representation of a Code Library](http://glench.github.io/fuzzyset.js/ui/)
232+
233+
[5] - Walid Maalej, Rebecca Tiarks, Tobias Roehm, and Rainer Koschke. [On the Comprehension of Program Comprehension](https://dl.acm.org/citation.cfm?id=2622669)
246234

247235
## ToDo
248236

0 commit comments

Comments
 (0)