EmbeddingGemma 2: an open, lightweight multimodal embedding model
deepmind.google·6d ago
TL;DR
A digital circuit simulator was developed in Haskell, closely mirroring the object-oriented approach of the SICP book. The implementation utilizes IORef for mutable state, achieving similar functionality without traditional mutable variables.
✦ Why It Matters
Consider using IORef in Haskell for projects requiring mutable state management.
Key Takeaways
How It Works
The simulator defines a 'Wire' type with an IORef for the signal value and another for action procedures. When a signal changes, the corresponding action procedures are executed, allowing downstream components to update accordingly.
This design mimics the observer pattern, facilitating dynamic circuit behavior.
Related