Functional Reactive Programming for .NET.
Two composable primitives: a stream of discrete events, and a cell holding a value over time. A transaction system updates everything you build from them atomically, so no observer ever sees a half-updated graph or a value that never logically existed. In C# and F#.
StreamSink<int> s = Stream.CreateSink<int>();
Cell<int> c = s.Hold(0);
IListener l = c.Listen(Console.WriteLine);
s.Send(2); // prints 2
s.Send(9); // prints 9
l.Unlisten();
SodaFlow is based on Sodium, the Functional Reactive Programming library by Stephen Blackheath and Anthony Jones, and began as that project's .NET implementation. The model documented here is Sodium's: streams, cells, behaviors, transactions, and the denotational semantics that SodaFlow implements unchanged. The credit for that model belongs upstream. Sodium's implementations for Java, Scala, C++, Kotlin, TypeScript, and Rust live under the SodiumFRP organization.
Start here
Going deeper
Elsewhere
- Book — Functional Reactive Programming
(Blackheath & Jones, Manning) is the best reference for both the Sodium model SodaFlow is
built on and for Functional Reactive Programming in general. Almost everything it teaches
applies directly here. Its worked examples live in
book/in C#, F#, and Java. - Issues — https://github.com/MorseCode-Software/SodaFlow/issues
- Sodium — the upstream project SodaFlow is based on: https://github.com/SodiumFRP/sodium. Its user forum, which covers the shared model rather than SodaFlow specifically, is at https://sodiumfrp.discourse.group/.