Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-14 Thread Robert Wills
Yes, I didn't realise that until Arjun mentioned that.  I'm going to
try to find some time to look more closely at Flapjax...

-Rob

On Wed, May 13, 2009 at 11:30 PM, Don Stewart d...@galois.com wrote:
 wrwills:
 The  only web-oriented frp framework that I know of is Flapjax
 http://www.flapjax-lang.org/

 Flapjax is javascript so possibly there could be a way to integrate it
 into Haskell using HJavascript?  Maybe it could even be integrated
 into Happstack?

 I'm also quite new to Haskell.

 Isn't the flapjax compiler implemented in Haskell?

 -- Don

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Robert Wills
The  only web-oriented frp framework that I know of is Flapjax
http://www.flapjax-lang.org/

Flapjax is javascript so possibly there could be a way to integrate it
into Haskell using HJavascript?  Maybe it could even be integrated
into Happstack?

I'm also quite new to Haskell.

-Rob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread minh thu
2009/5/13 Robert Wills wrwi...@gmail.com:
 The  only web-oriented frp framework that I know of is Flapjax
 http://www.flapjax-lang.org/

 Flapjax is javascript so possibly there could be a way to integrate it
 into Haskell using HJavascript?  Maybe it could even be integrated
 into Happstack?

 I'm also quite new to Haskell.

 -Rob
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


There is this link posted on reddit...
http://ambassadortothecomputers.blogspot.com/2009/04/functional-reactive-ajax-in-ocaml.html
http://www.reddit.com/r/programming/comments/8jqgn/monadic_functional_reactive_ajax_in_ocaml/

Cheers,
Thu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Arjun Guha
 Flapjax is javascript so possibly there could be a way to integrate it
 into Haskell using HJavascript?  Maybe it could even be integrated
 into Happstack?

The Flapjax compiler is written in Haskell, so that might help.

I assume you want to write FRP in a Haskell-embedded DSL and generate
FRP'd JavaScript.  If you wish to use Flapjax as a supporting library
I'd be glad to help.

Arjun
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Claus Reinke

I assume you want to write FRP in a Haskell-embedded DSL and generate
FRP'd JavaScript.  If you wish to use Flapjax as a supporting library
I'd be glad to help.


I'm curious: how difficult is it nowadays for in-page JavaScript to
control the evolution of its surrouding page, FRP-style? I used to
do something like that, but with VRML+JavaScript instead of HTML
+JavaScript (there's a screencast for those without VRML viewer;-):

http://community.haskell.org/~claus/FunWorlds/VRML/

and I found that mapping FRP style behaviours and events wasn't
the problem (though VRML has better support for this than HTML),
the problem was gaining the same advantages one would have from
embedding FRP in a functional language. Problems included scoping,
linking dynamically created material with enclosing scope (JavaScript being in strings with scopes 
separate from the enclosing

VRML, VRML to be created dynamically also via strings, also in their
own scope) 


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Claus Reinke

oops, sorry, keyboard accident


I assume you want to write FRP in a Haskell-embedded DSL and generate

FRP'd JavaScript.  If you wish to use Flapjax as a supporting library
I'd be glad to help.


I'm curious: how difficult is it nowadays for in-page JavaScript to
control the evolution of its surrouding page, FRP-style? I used to
do something like that, but with VRML+JavaScript instead of HTML
+JavaScript (there's a screencast for those without VRML viewer;-):

http://community.haskell.org/~claus/FunWorlds/VRML/

and I found that mapping FRP style behaviours and events wasn't
the problem (though VRML has better support for this than HTML),
the problem was gaining the same advantages one would have from
embedding FRP in a functional language. Problems included scoping,
linking dynamically created material with enclosing scope (JavaScript 
being in strings with scopes separate from the enclosing VRML, 
VRML to be created dynamically also via strings, also in their own 
scope) 


This became particularly obvious for dynamic recursion of reactive
behaviours, somewhat like 


 page n = code involving n `until` (keypress `then` (\key- page n))

How are such things handled in Flapjax, if it follows the embedded
compiler approach? 


Claus

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Arjun Guha
 This became particularly obvious for dynamic recursion of reactive
 behaviours, somewhat like
  page n = code involving n `until` (keypress `then` (\key- page n))

We have this function, which permits patterns like the one above:

http://www.flapjax-lang.org/docs/#tagRec

tagRec does not permit mutual recursion.  We've considered writing a
generalization that does.  But, it's almost easier to imperatively
close the loop.

Arjun
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Petr Pudlak
On Wed, May 13, 2009 at 06:46:45AM -0400, Arjun Guha wrote:
  Flapjax is javascript so possibly there could be a way to integrate it
  into Haskell using HJavascript?  Maybe it could even be integrated
  into Happstack?
 
 The Flapjax compiler is written in Haskell, so that might help.
 
 I assume you want to write FRP in a Haskell-embedded DSL and generate
 FRP'd JavaScript.  If you wish to use Flapjax as a supporting library
 I'd be glad to help.
 
 Arjun

Actually, I wanted to use Flapjax as the base for client-side programming.
I didn't think about combining Flapjax with HJavaScript, this is quite a good
idea.

However, this would is just one part of what I'd like to have. No doubt many
things can be done on the client, but more serious work or database
operations must be done on the server anyway. Ideally, I'd like to spare a
programmer from:
 * Working with HTML (unless explicitly desired); Instead, I'd prefer to
   compose the pages from components, either predefined or user-defined. This
   could be done for example using DSL in Haskell. The components could be both
   lightweight (almost HTML), or heavyweight like menu, toolbar etc.
 * Transferring data between a server/client. Especially using FRP, this might
   be done very neatly I suppose. An event stream or a behavior could be
   transferred seamlessly by the framework from the client to the server and
   vice versa.  The programmer would only see behaviors on either side.

I've been working with the ZK framework http://zkoss.org/ lately, and it has
many nice features. For example, composing pages from high-level components,
the possibility to separate the layout of the pages form the controlling
code, or sparing a programmer from working with HTML and HTTP requests -
everything is done just by manipulating component objects and handling
events. However, it's not functional at all. I believe FRP would be much better
solution than classical event handling. And secondly, it's in Java, which is
nothing bad (actually my code is in Scala), just it's not Haskell.

Happsstack looks good, though I didn't have time to study it.

Thanks for the links for OCAML JavaScript FRP, it looks iteresting too.

Petr
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Don Stewart
wrwills:
 The  only web-oriented frp framework that I know of is Flapjax
 http://www.flapjax-lang.org/
 
 Flapjax is javascript so possibly there could be a way to integrate it
 into Haskell using HJavascript?  Maybe it could even be integrated
 into Happstack?
 
 I'm also quite new to Haskell.

Isn't the flapjax compiler implemented in Haskell?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe