[m-users.] Web programming in Mercury: Simple example code?

Julien Fischer jfischer at opturion.com
Mon Dec 10 15:25:41 AEDT 2018

Hi Jeffrey,

On Sat, 8 Dec 2018, Jeffrey Brown wrote:

> I'd like to use Mercury to process a database, but write the rest of
> the code in Haskell. It seems natural to connect them via HTTP or
> WebSockets -- that way I won't have to break new ground by figuring
> out how to call Mercury from Haskell. Can anyone recommend a simple
> example of a web server written in Mercury? I looked through the
> libraries and see nothing web-related, so I assume I'll have to use
> the foreign function interface to call C or some other language.

There's a *very* rudimentary example for use with the deep profiler
in extras/posix/samples/mdprof_cgid.m.  In practice, I would do what
you suggest: choose the most appropriate embedded webserver for your
target language and communicate with that via the foreign language


More information about the users mailing list