cliffy-core
Reactive UI framework with geometric algebra state management.
Overview
cliffy-core provides the foundational FRP (Functional Reactive Programming) primitives for building reactive applications. It follows Conal Elliott's original FRP semantics with geometric algebra internals.
Core Primitives
Behavior
A continuous, time-varying value (Time -> T):
use ;
let count = new;
let doubled = count.map;
count.set;
assert_eq!;
// Combine multiple behaviors
let a = new;
let b = new;
let sum = combine;
Event
Discrete occurrences over time ([(Time, T)]):
use Event;
let clicks = new;
let click_count = clicks.fold;
clicks.emit;
clicks.emit;
assert_eq!;
Combinators
use ;
let show_message = new;
// Project through condition
let message = when;
// Select between alternatives
let theme = if_else;
Geometric State
State is represented using geometric algebra (GA3), enabling:
- Smooth interpolation via rotors
- Geometric transformations
- Conflict resolution via geometric mean
use ;
let state = from_vector;
let rotated = state.apply_rotor;
Features
- Classical FRP: Behavior and Event with automatic dependency tracking
- Geometric Algebra: State as GA3 multivectors for smooth interpolation
- Composable: Map, combine, fold, filter operations
- Zero-cost abstractions: Compiles to efficient code
Usage with Other Frameworks
cliffy-core is framework-agnostic and can be used with:
- Yew: Reactive state for Yew components
- Leptos: Signal-like reactivity
- Dioxus: State management layer
- WASM: Via
cliffy-wasmbindings
License
MIT