Module
Data.Incremental
- Package
- purescript-incremental-functions
- Repository
- paf31/purescript-incremental-functions
Incremental computation, based on
"A Theory of Changes for Higher-Order Languages" by Cai, Giarrusso, Rendel and Ostermann.
This module also defines a HOAS-style interface for working with function changes.
#Change Source
data Change a
A type level function which maps a type to the type of its change structure.
Uniqueness of instances makes the coercions fromChange
and toChange
safe,
since the functional dependency makes the change structure type unique.
Instances
#fromChange Source
fromChange :: forall da a. Patch a da => Change a -> da
#Jet Source
type Jet a = { position :: a, velocity :: Change a }
A value (position
) paired with a change (velocity
).
We can think of these modified terms as conceptually similar to dual numbers.
We can use functions of type Jet a -> Jet b
as incremental
functions from a
to b
, which gives us a HOAS-style DSL for working
with jets.