@hackage Shpadoinkle-backend-pardiff0.3.0.1
A Virtual Dom in pure Haskell, based on Html as an Alignable Functor.
Categories
License
BSD-3-Clause
Maintainer
isaac.shapira@platonic.systems
Links
Versions
Installation
Dependencies (14)
- Shpadoinkle
- base >=4.12.0 && <4.16
- compactable >=0.1.2 && <0.2
- containers >=0.6.0 && <0.7
- exceptions
- file-embed >=0.0.11 && <0.1 Show all…
Dependents (2)
@hackage/Shpadoinkle-examples, @hackage/Shpadoinkle-developer-tools
Shpadoinkle Backend ParDiff
Shpadoinkle's ParDiff backend is a virtual dom diffing system written in pure Haskell. It currently serves as the canonical backend for Shpadoinkle, such that the behavior of other backends should conform.
The virtual tree in ParDiff contains a reference to the RawNode for each element. Merging
unkeyed and keyed virtual dom techniques together. This allows for rendering to be performed
in a keyed fashion for all nodes, while not requiring additional memory or developer overhead.
The diffing itself is a lawful usage of alignWith from the Data.These package. By modeling
Html as an Alignable Functor, you get principled diffing with clear separation of concerns.
IO is done using JSaddle, and works with both GHC and GHCjs.