Questions tagged [reactive-banana]

reactive banana is a Haskell library for functional reactive programming

Reactive Banana:

Functional reactive programming offers an elegant and concise way to express interactive programs such as graphical user interfaces, animations, computer music or robot controllers. It promises to avoid the spaghetti code that is all too common in traditional approaches to GUI programming.

The goal of the library is to provide a solid foundation.

115 questions
269
votes
1 answer

How fundamentally different are push-pull and arrowized FRP?

I want to study FRP in Haskell, but it's a bit difficult to decide on a library to use. Many seem to be dead attempts, some seem to have been resurrected (such as recent activity on Yampa). From what I read, it seems that there are two "kinds" of…
Guillaume Ponce
  • 2,503
  • 2
  • 12
  • 9
26
votes
1 answer

Does push-pull FRP help when implementing games?

I've been comparing pull-only FRP (ie netwire) with push-pull FRP (ie reactive-bannana) in the implementation of games. Are there advantages to one over the other? Things I've notices are: Push events make it easy to have events for mouse clicks /…
Dan
  • 12,409
  • 3
  • 50
  • 87
26
votes
2 answers

Which FRP package to choose?

I'm just starting to look into the world of Functional Reactive Programming in Haskell, and I would like to experiment with GUI programming (with gtk, because of substantial binding) in a reactional setting. Now, I've been looking a bit at…
plc
  • 864
  • 8
  • 20
24
votes
4 answers

FRP - Event streams and Signals - what is lost in using just signals?

In recent implementations of Classic FRP, for instance reactive-banana, there are event streams and signals, which are step functions (reactive-banana calls them behaviours but they are nevertheless step functions). I've noticed that Elm only uses…
19
votes
1 answer

How to implement a game loop in reactive-banana?

This question is specific to reactive-banana and real-time simulations with a physical and visual component (eg., games). According to Fix Your Timestep! the ideal way to setup a game loop (assuming physics that needs to be reproducible), you need a…
Jason Dagit
  • 13,684
  • 8
  • 33
  • 56
16
votes
1 answer

reactive-banana: Firing event that contain the most up to date value of a Behavior

Suppose I have an event trigger which I want to do two things when fired. First, I want it to update the value of some behavior. Second, if other conditions are met, I want it to fire another event send_off with the updated value of the behavior. …
16
votes
1 answer

Am I using reactive-banana right?

Here's an example Haskell FRP program using the reactive-banana library. I'm only just starting to feel my way with Haskell, and especially haven't quite got my head around what FRP means. I'd really appreciate some critique of the code below {-#…
Ben Ford
  • 2,087
  • 21
  • 26
15
votes
1 answer

Can reactive-banana handle cycles in the network?

We have code like this: guiState :: Discrete GuiState guiState = stepperD (GuiState []) $ union (mkGuiState <$> changes model) evtAutoLayout evtAutoLayout :: Event GuiState evtAutoLayout = fmap fromJust . filterE isJust . fmap autoLayout $…
mentics
  • 6,852
  • 5
  • 39
  • 93
14
votes
1 answer

reactive-banana: How to create an AddHandler?

I'm currently trying to get to know FRP through Heinrich Apfelmus' reactive-banana, which seems to be a quite well documented and simple library, compared to the other ones I've looked at. However, I can't wrap my head around the AddHandler type.…
bzn
  • 2,362
  • 1
  • 17
  • 20
12
votes
1 answer

Functional-Banana Traveller Game - Intriguing and Maddening

I want to use reactive-banana to write a traveller game that people can write bots for. FRP is completely new to me, and I'm having trouble making a start. I created a more elaborate Graph, when I began, but for my purposes here, I have tried to…
user1198582
11
votes
4 answers

Behavior in reactive-banana

Pardon me, I'm just starting to look into reactive-banana and FRP. The author of reactive-banana made this example per my suggestion, in which he creates a counter which can be increased and decreased. He uses accumE function which accumulates…
Masse
  • 4,334
  • 3
  • 30
  • 41
11
votes
3 answers

Why should we use Behavior in FRP

I am learning reactive-banana. In order to understand the library I have decide to implement a dummy application that would increase a counter whenever someone pushes a button. The UI library I am using is Gtk but that is not relevant for the…
mathk
  • 7,973
  • 6
  • 45
  • 74
11
votes
1 answer

Is there a reactive-banana-gtk?

I found the reactive-banana-wx and wonder if there is also a similiar package for gtk as reactive banana should support gtk according to http://www.haskell.org/haskellwiki/Reactive-banana
sleepomeno
  • 193
  • 8
10
votes
1 answer

FRP frameworks and IO

I've just been investigating FRP in Haskell (mainly reactive-banana (testimonials!)), and I'm wondering is it common for them, and in case of reactive-banana what's the reason to operate in IO monad instead of being constrained to MonadIO, or rven…
Bartosz
  • 3,318
  • 21
  • 31
10
votes
2 answers

"Behavior now" in FRP

In a previous SO question (Is it possible?: Behavior t [Behavior t a] -> Behavior t [a]) we were analyzing the existence of a Behavior join (to use reactive-banana terms). Behavior t (Behavior t a) -> Behavior t a Implemented in the semantic model…
J. Abrahamson
  • 72,246
  • 9
  • 135
  • 180
1
2 3 4 5 6 7 8