43

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.

EvgenijM86
  • 1,879
  • 1
  • 16
  • 10
  • 5
    +1 just for the name "reactive banana". I'm ignorant of FRP, so I appreciate the heads up there as well. – duffymo Feb 09 '12 at 12:00

6 Answers6

45

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

Heinrich Apfelmus
  • 11,039
  • 1
  • 35
  • 66
  • Thank you. That's what I was looking for - the sources you yourself have used to make this library. – EvgenijM86 Feb 09 '12 at 17:33
  • 1
    If you do manage to build up comprehensive documentation, then perhaps you can make some additional money by selling it, a la Yesod book. – Dan Burton Feb 09 '12 at 20:07
  • 1
    @DanBurton: Good idea! Needs to be really comprehensive then to qualify as a book, though. I'll figure something out. – Heinrich Apfelmus Feb 10 '12 at 08:19
  • Do you also have some kind of wikipedia, or wikibook? It's a good way of organizing volunteered information. – tinlyx Apr 29 '14 at 08:46
  • 1
    @TingL The [Haskell wiki](http://www.haskell.org/haskellwiki/Reactive-banana) can be used for this purpose. – Heinrich Apfelmus Apr 30 '14 at 13:33
  • Here's correct link to: [Tutorial slides](https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana/doc/hal7/slides-en.pdf) – Dimchansky May 28 '15 at 18:22
  • @HeinrichApfelmus Another good resource on the Haskell wiki was [pointed out by @jonathan-potter](http://www.haskell.org/haskellwiki/FRP_explanation_using_reactive-banana) – hololeap Nov 18 '17 at 21:32
9

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".

John L
  • 27,467
  • 4
  • 67
  • 87
  • 2
    Recursion! This question originated as a comment on Apfelmus's blog, to which he replied "repost on SO and I'll answer it there". Apfelmus's post eagerly awaited... – Rob Agar Feb 09 '12 at 14:48
  • To me, "Functional Reactive Animation" (http://conal.net/papers/icfp97/) is a better introduction to FRP than the Simply Efficient paper. Even though the implementation is different, the ideas and inspiration are very clear in the former. – luqui Feb 09 '12 at 22:26
4

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

Oliver
  • 2,246
  • 2
  • 16
  • 12
3

I've blogged about FRP and reactive-banana. Take a look here and see if it can be useful:

http://alfredodinapoli.wordpress.com/2011/12/24/functional-reactive-programming-kick-starter-guide/

HTH,

A.

Alfredo Di Napoli
  • 2,201
  • 3
  • 19
  • 26
2

I'm in the same boat as you, and I found "FRP explanation using reactive-banana" when looking for resources. It's targeted at FRP beginners.

Olathe
  • 1,859
  • 1
  • 15
  • 23
Jonathan Potter
  • 2,539
  • 1
  • 21
  • 18
1

Recently I ported my 'streamed' package to 'reactive-banana'. The package is intended for real-time processing of MIDI messages, e.g. for generating accompaniments, musical games and some fun effects.

http://code.haskell.org/~thielema/reactive-balsa/

How did I start learning reactive-banana? I just asked the author of the package and he kindly helped me to do the first steps. After taking the first steps, I found the Haddock documentation of the package very helpful. Now you can choose between the package author and me to give you first hints on how to start with reactive-banana. :-)

Lemming
  • 11
  • 1