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
9
votes
3 answers

Sampling a behaviour from outside network

Since sodium has been deprecated by the author I'm trying to port my code to reactive-banana. However, there seem to be some incongruencies between the two that I'm having a hard time overcomming. For example, in sodium it was easy to retrieve the…
Philonous
  • 91
  • 5
9
votes
1 answer

Reactive Banana 1.0.0 - Unit testing in the MomentIO() Monad

Here's an event network sample that I've been using to investigate the behavior of particular monadic actions. I'm wanting a principled approach, rather than this ad-hoc way of testing my code. I know how to test my functions, but I'm looking for…
user1198582
9
votes
2 answers

Event handling in Netwire compared to conventional FRP frameworks

Most Haskell FRP frameworks like AFRP, Yampa and Reactive-banana make a difference between continuous time-varying functions and discrete ones. Usually they call them behaviors and events. One exception is Netwire, which uses an inhibition monoid to…
Dmitry Vyal
  • 2,347
  • 2
  • 24
  • 24
8
votes
2 answers

Execute MonadIO action inside of reactimate

In reactive-banana, I am trying to run reactimate :: Event (IO ()) -> Moment () with some actions of Arduino in hArduino package, an instance of MonadIO. There seems no function of Arduino a -> IO a provided in the package. How would you execute…
Ryoichiro Oka
  • 1,949
  • 2
  • 13
  • 20
8
votes
1 answer

Why does `changes` return `Event t (Future a)`

The changes function has type Frameworks t => Behavior t a -> Moment t (Event t (Future a)). Future is abstract and there is only one function that consumes it (reactimate'). However, I can easily write the following function: changes' :: Frameworks…
Tobias Brandt
  • 3,393
  • 18
  • 28
8
votes
0 answers

How to use reactive banana with Gtk2Hs?

I am trying to get some experience with reactive-banana, accord to its website, it should support GTK. I was wondering if there is any tutorial/introductory material on how to do that? I read here in SO that there is a jaek project, but I am more…
thor
  • 21,418
  • 31
  • 87
  • 173
8
votes
2 answers

reactive-banana time delays

I have scoured the documentation of reactive-banana, and I can't find a way to specify explicit time delays. Say, for example, I would like to take an Event t a and shift all of its occurrences 1 second into the future; or get an event that fires 1…
luqui
  • 59,485
  • 12
  • 145
  • 204
8
votes
1 answer

Reactive table with reactive banana and gtk2hs

I have written a small application which tracks my progress in TV Series. The application is written in Haskell with functional reactive programming (FRP) with reactive banana. The application can: add/remove new TV Series to the table change the…
SvenK
  • 2,584
  • 2
  • 21
  • 24
8
votes
1 answer

Dynamic Event Switching in Reactive-Banana

I am currently working on a small game utilizing reactive banana and SDL. Since the goal is mostly to learn more about reactive banana and FRP, I attempted to use dynamic switching to set up a collection of game objects, but without much success so…
AsgarZigel
  • 153
  • 5
8
votes
1 answer

Handling mutually recursive GUI widgets with reactive-banana

I am hunting for a library to write a GUI on top of GLFW and OpenGL. I'm doing this because I am dissatisfied with the common UI library bindings which I feel are too imperative, and I would also like tight control of the look and feel of my UIs.…
danharaj
  • 1,613
  • 14
  • 19
7
votes
1 answer

What's wrong with my "sum event" in reactive-banana?

I'm learning reactive-banana and intending to use it in a server-side app. I have some background in RxJs, so I'm used to combining Events with different combinators there. So I started with simple event combinator examples. I tried to make a simple…
raimohanska
  • 3,265
  • 17
  • 28
7
votes
1 answer

Reactive Banana: State monad or not?

I have an interface (WX) which is based on Reactive Banana. Now I have different questions about how to really manage the status: Should I consider the state as the Behaviors that I define in the code? If the state depends on external "events" too,…
Randomize
  • 8,651
  • 18
  • 78
  • 133
7
votes
2 answers

Why do some of threepenny-gui FRP combinators operate on a MonadIO monad instead of being pure?

First of all a disclaimer, I might have misunderstood completely the way threepenny-gui works due to my not so advanced knowledge of Haskell, so take my assertions with a grain of salt. :-) It seems to me that some combinators are not pure…
miguel.negrao
  • 949
  • 5
  • 13
7
votes
1 answer

Push vs pull in reactive-banana

I am building a mediaplayer-like application using reactive-banana. Let's say I want a Behavior that represents the currently selected track in the track list. I have two options: use fromPoll to get the current selection when it's needed; or use…
Roman Cheplyaka
  • 37,738
  • 7
  • 72
  • 121
7
votes
1 answer

Functional Banana Traveller - Timer and player independent Events

I'm at the point in my Traveller I'm trying to handle player-independent updates to the game state. For reference, the project is here (the devel branch is the relevant one for this question). Libraries/Universe/GameState.hs has a function, updateGS…
user1198582