Dear camlers,

I'm looking for advanced examples of GUI programming in functional style. As I'm aware there is no definitive answer on this topic, I'll gladly read about pragmatic approaches which may fail to be fully declarative, but do work well in practice. Lately I've been trying to write a little GUI API, replacing all mutable values by React signals (http://erratique.ch/software/react), but it turns out to be more difficult than expected, for example with layout management. In order to compute a layout for the widgets, some information has to travel bottom up the widget hierarchy, and some goes top down. While there is a well-founded order for defining all signals, it's more difficult to group them in their respective widget and still avoid mutually recursive definitions. More generally I'd interested in good (and pragmatic !) techniques for GUI programming, with some real life code.
Cheers,
  Philippe.