[Haskell-cafe] First go at reactive programming

Steve Lihn stevelihn at gmail.com
Sat Jan 19 12:22:43 EST 2008


> -- | @'forever' act@ repeats the action infinitely.
> forever     :: (Monad m) => m a -> m ()
> forever a   = a >> forever a

Great. The code compiled successfully by inserting this in various places.

> I'm wondering how hard to try to get these libs to work with both 6.6 and
> 6.8.  My hope has been that people will switch to 6.8, but perhaps there are
> obstacles I don't know about.  Is there something that keeps you from
> upgrading?

I am asking this question in another thread. The problem is -- I've
got many modules compiled under 6.6, some with much agony. If I switch
to 6.8, I have to recompile them again. Two issues I image:

(1) It may take lots of effort to recompile all the modules. I have
forgetten how I got around some of the modules! Too bad... Got to take
notes next time...
(2) If I got stuck in 6.8, it may not be easy to switch back.

It does not appear straightforward to me. I'd like to hear how other
people approach these issues before I jump into it. Don't want to
break the working environment that I spent months to set up!
--
Finally, get to test the Reactive sample code.

(1) Levi's first post compiled successfully and worked like charm. Congrat.
(2) Levi's second post did not compile. There is a type error...

react.hs:33:65:
    Couldn't match expected type `Handle'
           against inferred type `RequestHandler'
    In the first argument of `handleConnection', namely `r'
    In the first argument of `fmap', namely `(handleConnection r)'
    In the second argument of `(.)', namely `fmap (handleConnection r)'

Thanks.
Steve


More information about the Haskell-Cafe mailing list