[Haskell-cafe] Web server with dynamic data

Hans Georg Schaathun georg+haskell at schaathun.net
Tue Aug 16 19:08:50 UTC 2022


I have been fiddling with this idea for some time, and I wonder
if this may be the right place to ask a rather probing question!?
It has been some years since my last visit to the list.

I have been searching for examples using functional reactive 
programming to make web servers, but this proves surprisingly
hard to find.  I found the netwire library, but given that the
last update was 2011 I am not sure I want to risk that ...

So maybe I was asking the wrong question.  I have a rather
complex system of RDF Graphs (using Swish), with reasoners making 
derived graphs, and updates being made only on the original graphs.
There are multiple constituent graphs to avoid having to
recompute everything upon update.  Now I was thinking that
this looks like a typical case for FRP, with each graph a 
Behaviour, recomputing derived graph only when the source
behaviour changes.  I am not sure if I am right.  Any opinions? 

The second part of this is the web server to allow queries
(read and update) to the RDF Graphs.  The first prototype uses
Scotty with STM for storage, but when I add more constituent 
graphs, I really do not want an update to block access to other
constituent graphs, which is what I thought I could avoid in an
FRP model.  Without much experience writing interactive stuff in 
Haskell, I cannot figure out how to wire the interaction between 
Scotty and either netwire or banana which are the two FRP libraries
I have tried to comprehend.  Are there any examples out there to
look at?

I am not really committed to any library or paradigm, except
for RDF and Swish, so any ideas will be welcome, even pointing
me away from everything I thought I needed ...

Thanks for reading,
:-- George

More information about the Haskell-Cafe mailing list