Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
Created September 11, 2015 04:56
Show Gist options
  • Save gakuzzzz/25acfa7fe90844978f49 to your computer and use it in GitHub Desktop.
Save gakuzzzz/25acfa7fe90844978f49 to your computer and use it in GitHub Desktop.
DDD free monad
trait User {
def present[F[_]](item: Item, targetUser: User)(implicit I: Item[F]) = {
import I._
for {
onwership <- buy(item)
_ <- targetUser.take(onwership)
} yield ()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment