Skip to content

Instantly share code, notes, and snippets.

@kryptt
Last active August 17, 2020 11:07
Show Gist options
  • Save kryptt/af0a626849f0e3f5b16fcd161a5545e4 to your computer and use it in GitHub Desktop.
Save kryptt/af0a626849f0e3f5b16fcd161a5545e4 to your computer and use it in GitHub Desktop.
val BalanceSheetId: Lens[BalanceSheet, DatabaseID] =
GenLens[BalanceSheet](_.id)
def save(sheet: BalanceSheet): IO[DatabaseID] = ???
//Updates a given sheet with the new id from the database
def store(sheet: BalanceSheet): IO[BalanceSheet] =
save(sheet).map(BalanceSheetId.set(_)(sheet))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment