Skip to content

Commit

Permalink
Make README example clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Wills committed Apr 27, 2016
1 parent d728740 commit d8db989
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -103,11 +103,13 @@ scala> def temptWithGum(child: LuckyWinner): LuckyWinner = child match {
| }
scala> val luckyWinners = Table[LuckyWinner]("winners")
scala> val operations = for {
| _ <- luckyWinners.putAll(
| List(LuckyWinner("Violet", "human"), LuckyWinner("Augustus", "human"), LuckyWinner("Charlie", "human")))
| winners <- luckyWinners.scan()
| _ <- luckyWinners.putAll(winners.flatMap(_.toOption).map(temptWithGum).toList)
| results <- luckyWinners.getAll('name -> List("Charlie", "Violet"))
| _ <- luckyWinners.putAll(
| List(LuckyWinner("Violet", "human"), LuckyWinner("Augustus", "human"), LuckyWinner("Charlie", "human")))
| winners <- luckyWinners.scan()
| winnerList = winners.flatMap(_.toOption).toList
| temptedWinners = winnerList.map(temptWithGum)
| _ <- luckyWinners.putAll(temptedWinners)
| results <- luckyWinners.getAll('name -> List("Charlie", "Violet"))
| } yield results

scala> Scanamo.exec(client)(operations).toList
Expand Down

0 comments on commit d8db989

Please sign in to comment.