flyp-inc/etabase/1.0.0

NOTE: the latest version is 2.0.0

Col

Represents a "column" semantic, with support for tracking changes over time.

Type

type Col a

Opaque type representing a "column".

Create, update

init : Posix -> a -> Col a

Create a new Col a.

cons : Posix -> a -> Col a -> Col a

Update a value in a Col a, tracking changes.

touch : Posix -> Col a -> Col a

Update a Col a's timestamp without adding a record to its history.

Access values

value : Col a -> a

Get a value from a Col a.

updatedAt : Col a -> Posix

Get a Col a's timestamp`.

history : Col a -> List ( Posix, a )

Get all changes on a Col a, in order from newest to oldest.

Aggregation

toUpdatedAt : List (a -> Posix) -> Posix -> a -> Posix

For a list of Col values on a record a, calculate when the record was last updated.