Skip to content

Instantly share code, notes, and snippets.

@cark
Created September 17, 2012 05:01
Show Gist options
  • Save cark/3735643 to your computer and use it in GitHub Desktop.
Save cark/3735643 to your computer and use it in GitHub Desktop.
insertPerson :: MonadState MyDb m => Person -> m (Fact Person)
insertPerson = insertRecord personRel
--fillit :: MonadState MyDb m => m ()
fillit = do
a <- insertPerson (Person "john")
b <- insertPerson (Person "paul")
return ()
-- if i leave the type declaraion of fillit commented, i get this error :
No instance for (MonadState MyDb m0)
arising from a use of `insertPerson'
Possible fix: add an instance declaration for (MonadState MyDb m0)
In a stmt of a 'do' block: a <- insertPerson (Person "john")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment