reflex-frp / reflex

Interactive programs without callbacks or side-effects. Functional Reactive Programming (FRP) uses composable events and time-varying values to describe interactive systems as pure functions. Just like other pure functional code, functional reactive code is easier to get right on the first try, maintain, and reuse.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
1.07k stars 150 forks source link

100% haddock coverage #153

Open ryantrinkle opened 6 years ago

sboosali commented 6 years ago

Can you add laws and simple examples for all functions listed in the cheatsheet?

https://github.com/reflex-frp/reflex/blob/develop/Quickref.md

Like their relationships, when one is primitive and others are derived, especially their relationships with never and constant (and other base cases, like the empty list, the empty map, 0, etc).

ryantrinkle commented 6 years ago

@sboosali That sounds great, too :) I think it would be nice if we could use doctest or something like that to ensure they are (and stay) valid.

ag-eitilt commented 6 years ago

Doctest would be nice, but it seems to require something be written to the terminal, and tellEvent only gets us so far. From the tests, I know it's possible to complete the bridge to IO [a], but I wasn't able to tease apart the Test.Run code enough to simplify the type signature; someone with better knowledge of the code internals may have better luck. If we can get a tellEventIO :: Event t a -> IO [a] or similar, though, the docs could become amazing.