Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:29:53+00:00 2026-06-14T16:29:53+00:00

In my very first impression of Haskell, it’s a language can handle execute-then-result things

  • 0

In my very first impression of Haskell, it’s a language can handle “execute-then-result” things amazingly well. But I can’t find how to implement “event-driven” things like games, or HTTP/FTP/TCPSocket servers.

This question got answered after I read some papers about FRP, include Yampa and the FPS game created by it ( Frag ). It seems that the FRP is a nice model to implement “heavy” event-driven things like 3D game, but how about slighter event-driven applications like HTTP servers or normal desktop GUI programs ? What cons will appear if I use FRP to implement all these things ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:29:55+00:00Added an answer on June 14, 2026 at 4:29 pm

    FRP is a very general technique and could almost certainly be used to implement anything that would normally use events. In the classical rendition of FRP, one of the core abstractions is the event. The difference is that instead of operating on events individually with callbacks, you operate on streams of events.

    You should be able to render any normal event-driven code in terms of streams of events; the only difficulty would be in binding your streams with existing, external code like a GUI toolkit; however, this is more tedious than tricky. So I don’t see any fundamental issue preventing you from using FRP anywhere you would use events in a different language.

    In fact, I’ve had some good experiences using FRP for exactly what you call “lighter”: simple GUI programs. I’ve used reactive banana with wxWidgets to write some very simple little graphical programs. I found the resulting code to be much simpler, easier to write and easier to read than the equivalent callback-based code would have been.

    Reactive Banana can also be used for things like music, so it’s clearly widely applicable. I haven’t tried anything except GUI programming with it, but others have so it has to be possible.

    Additionally, you should check out Elm which is an ML-style language for implementing web apps with FRP. It generates everything you need: HTML, CSS and JavaScript. I believe it even handles communication with the server. I haven’t tried it, but it looks very nice.

    So, people are clearly using FRP in a wide variety of domains, including ones that aren’t “heavy”. But this does not mean you should use it everywhere!

    For one, it is possible to get unpredictable space and time behavior. I know that the creators of both Reactive Banana and Elm put a lot of effort into reducing these, but I suspect there is still some risk. I know I had some very odd space leaks when playing around with Reactive Banana WX, so it’s certainly something to look out for. It might be harder to deal with these with FRP than with event-drive code you’re used to working with. Of course, I’ve had inexplicable memory leaks with standard JavaScript, so non-FRP code isn’t immune to this either!

    Another consideration is that FRP may not be the best or clearest abstraction for your particular task. While it’s great for things that have to be fully reactive, what about code that is very simple, like a web server? (I mean simple as in different requests probably do not interact too closely with each other.) I imagine having a web framework that handled large amounts of requests using a programming model based on FRP would be possible; I just don’t think it would be optimal.

    In fact, my understanding is that the GHC IO system is actually already event-driven under the hood, so you can write web servers in a standard programming style and get the benefits of using events for free. So, for web server code, a simpler underlying abstraction may be a better choice. I believe that’s what existing frameworks like Snap and Yesod do–neither uses a reactive programming style, but both are still pleasant to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this was one of my very first questions here, but I have a
I am trying to write my very first python script. This was working but
How can I detect the very first time launch of - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
The very first step i created a DFD. Then i moved on to create
This is my VERY FIRST Makefile and so I have cut and paste junk
I'm programming my very first GUI app in Java using the Swing framework. I've
I have build my very first application to Android and I want now to
I am a frequent R user (the very first program I turn on everyday
I've been seeing this instruction as the very first line of numerous CSS files
When I try to create the a table the very first time, I always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.