Created
December 1, 2010 09:08
-
-
Save debasishg/723215 to your computer and use it in GitHub Desktop.
This file contains 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
// failure case | |
scala> makeTrade("a-123", "google", "ref-12", Singapore, -10, 600) | |
res2: scalaz.Validation[scalaz.NonEmptyList[String],net.debasishg.domain.trade.Trades.Trade] = Failure(NonEmptyList(price must be > 0, qty must be <= 500)) | |
// success case | |
scala> makeTrade("a-123", "google", "ref-12", Singapore, 10, 200) | |
res3: scalaz.Validation[scalaz.NonEmptyList[String],net.debasishg.domain.trade.Trades.Trade] = Success(Trade(a-123,google,ref-12,Singapore,10,200)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment