Skip to content

Instantly share code, notes, and snippets.

@hanshoglund
Last active March 2, 2017 19:30
Show Gist options
  • Save hanshoglund/c1b71fe27800f8c33bfc2cf15e471a27 to your computer and use it in GitHub Desktop.
Save hanshoglund/c1b71fe27800f8c33bfc2cf15e471a27 to your computer and use it in GitHub Desktop.
type TransId = Integer
data State -- AffineSpace wh Diff is just a Monoid (name?), Diff State ~ Trans
data Trans -- Monoid
data Query -- JoinSemilattice
runTrans :: Trans -> State -> State -- modifies the state arbitrarily
runQuery :: Query -> State -> State -- selects a subset of the state
forceCommit :: Trans -> m Bool
tryCommit :: TransId -> Trans -> m Bool
lastTrans :: m TransId
query :: TransId -> Query -> State
-- Relation to get/set and lenses
-- Query as Getter (s -> a)
-- Trans as Setter (s -> b -> t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment