Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended reading/tutorials to understand reactive-banana FRP library [closed]

I'm interested in FRP (Functional Reactive Programming) reactive-banana haskell library. What would you recommend reading for a newbie to understand theory behind reactive-banana? As I understand, there have been some progress in this field and different FRP libraries use different approaches, so I don't think that any FRP paper would do.

like image 657
EvgenijM86 Avatar asked Feb 09 '12 11:02

EvgenijM86


3 Answers

Unfortunately, I haven't written any comprehensive documentation or tutorials yet, mainly because the reactive-banana library is still somewhat in flux.

This means that, at the moment, you'll have to figure things out yourself from various sources, backed by a reasonably strong Haskell knowledge. What I can do here is to list the various sources and inspirations.

  • Documentation available for reactive-banana directly

    • Really short introduction — mainly answers the question "Why do I need to know about Applicative Functors in order to understand reactve-banana?"
    • Tutorial slides [PDF] — explain and visualize the concepts of Behavior and Event
    • API Reference
    • Example Code — The examples start simple and are really useful for understanding the library.
    • Model implementation — Look at the source code. Useful for understanding the details of the programming model.
  • Since reactive-banana is based on Conal Elliott's work, his writings are a good source

    • "Functional Reactive Animation" — General, though somewhat outdated overview of FRP.
    • "Declarative event-oriented programming" — Practial example that demonstrates the utility of FRP for GUI programming. Excellent introduction to the general programming philosophy.
    • "Push-pull functional reactive programming" — Good read for understanding how the model is mapped to an API in terms of applicative and other functors.
like image 179
Heinrich Apfelmus Avatar answered Oct 26 '22 14:10

Heinrich Apfelmus


There are basically two sources:

  1. Conal Elliott's paper "Simply Efficient Functional Reactivity" (as well as Conal's other work leading to this paper).
  2. Apfelmus's blog. The article "Reactive Banana and the Essence of FRP" is probably a good starting point.

The design and semantics of reactive-banana draw heavily from Conal's paper and his "reactive" library (since reactive-banana-0.2). Discussion on a lot of the reasoning behind this, as well as differences between the libraries, is in the comments on Apfelmus's blog. Unfortunately "reactive" has some bad behavior associated with its "switcher" function, so that was left out of reactive-banana. There's been a lot of research into the nature of this problem and how to solve it, and it looks like reactive-banana-0.5 may introduce some version of "switcher".

like image 20
John L Avatar answered Oct 26 '22 14:10

John L


It's not reactive-banana but I found this series helpful for understanding FRP, building up a small pong game from scratch.

https://github.com/leonidas/codeblog/blob/master/2012/2012-01-08-streams-coroutines.md https://github.com/leonidas/codeblog/blob/master/2012/2012-01-17-declarative-game-logic-afrp.md

like image 4
Oliver Avatar answered Oct 26 '22 14:10

Oliver