Skip to content

Instantly share code, notes, and snippets.

@bananu7
Created January 15, 2015 14:32
Show Gist options
  • Save bananu7/ba12eed7cb05ff171bfe to your computer and use it in GitHub Desktop.
Save bananu7/ba12eed7cb05ff171bfe to your computer and use it in GitHub Desktop.
-- This:
data GlishaState us libs = GlishaState {
userState :: us,
libraryState :: libs,
window :: G.Window,
drawFn :: DrawFn us
}
-- Action monad parametrized over us and libs
-- Both us and libs hoisted into MonadState for library or client
-- vs
data GlishaState us = GlishaState {
userAndLibraryState :: us,
window :: G.Window,
drawFn :: DrawFn us
}
-- Action monad parametrized over one type. Library defines its state as user does it right now, but *also* parametrized over user state. Library can see user state as part of its state. User gets it hoisted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment