Created
September 11, 2015 04:56
-
-
Save gakuzzzz/25acfa7fe90844978f49 to your computer and use it in GitHub Desktop.
DDD free monad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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