From 6444baa72396ffa7ad26e59967c2dcd43c90877c Mon Sep 17 00:00:00 2001 From: muqiuhan Date: Sun, 15 Sep 2024 14:27:49 +0000 Subject: deploy: 838f92a9b62d46d4ec5e00c896896255ddcdf7ab --- .../index.html | 16 +- .../index.html | 367 +++++++++++++++++++++ .../index.html" | 282 ++++++++++++++++ 3 files changed, 664 insertions(+), 1 deletion(-) create mode 100644 2024/09/15/Advanced-C-binding-using-ocaml-ctypes-and-dune/index.html create mode 100644 "2024/09/15/\350\202\251\345\221\250\347\202\216\345\222\214\350\202\251\350\242\226\346\215\237\344\274\244\347\232\204\345\214\272\345\210\253/index.html" (limited to '2024/09') diff --git a/2024/09/12/Functional-Reactive-Programming-in-F/index.html b/2024/09/12/Functional-Reactive-Programming-in-F/index.html index dd82f7a2..301be807 100644 --- a/2024/09/12/Functional-Reactive-Programming-in-F/index.html +++ b/2024/09/12/Functional-Reactive-Programming-in-F/index.html @@ -146,6 +146,12 @@ + + + Archive + + + F# @@ -172,7 +178,10 @@
-

Events are everywhere. Almost every program has to handle events, whether it be button clicks in the user interface, listening to sockets in a server, or even a system shutdown notification.

+
+

https://fsharpforfunandprofit.com/posts/concurrency-reactive/

+
+

Events are everywhere. Almost every program has to handle events, whether it be button clicks in the user interface, listening to sockets in a server, or even a system shutdown notification.

And events are the basis of one of the most common OO design patterns: the “Observer” pattern.

But as we know, event handling, like concurrency in general, can be tricky to implement. Simple event logic is straightforward, but what about logic like “do something if two events happen in a row but do something different if only one event happens” or “do something if two events happen at roughly the same time”. And how easy is it to combine these requirements in other, more complex ways?

Even if you can successfully implement these requirements, the code tends to be spaghetti like and hard to understand, even with the best intentions.

@@ -297,6 +306,11 @@