Skip to content

Instantly share code, notes, and snippets.

@Gryff
Created February 21, 2019 11:16
Show Gist options
  • Save Gryff/f009de8b354a5ffa533765967caaf95d to your computer and use it in GitHub Desktop.
Save Gryff/f009de8b354a5ffa533765967caaf95d to your computer and use it in GitHub Desktop.
printStatement :: StateT [Transaction] IO ()
printStatement = innerPrintStatement putStr
innerPrintStatement :: Monad m => (String -> m ()) -> StateT [Transaction] m ()
innerPrintStatement printer = do
  transactions <- get
  let statement = generateStatement transactions
  lift (printer statement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment