Module

Gesso.State

Package
purescript-gesso
Repository
smilack/purescript-gesso

Types used when dealing with multiple versions of the same thing - most often, the application state.

#Compare Source

type Compare a = { new :: a, old :: a }

Two different versions of the same thing. Used when the old and new versions are probably not immediately sequential - there may have been many versions between old and new.

#History Source

type History a = { changed :: Boolean, new :: a, old :: a, original :: a }

A record for keeping track of changes to a value which may change many times, when it is important to track the original, current, and previous values, and comparing the values directly is impossible. Useful as an accumulator when folding.

#States Source

type States a = { current :: a, previous :: a, t :: Number }

Two different, sequential versions of the same thing, and the amount of progress from the earlier to the later. t should be in the interval [0, 1].

#lerp Source

lerp :: States Number -> Number

Calculate the linear interpolation between two values