Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created December 1, 2010 09:08
Show Gist options
  • Select an option

  • Save debasishg/723213 to your computer and use it in GitHub Desktop.

Select an option

Save debasishg/723213 to your computer and use it in GitHub Desktop.
// another trade
scala> val t2 = Map("account" -> "b-123", "instrument" -> "ibm", "refNo" -> "r-234", "market" -> "Singapore", "unitPrice" -> "15.25", "quantity" -> "400")
t2: scala.collection.immutable.Map[java.lang.String,java.lang.String] = Map((quantity,400), (market,Singapore), (refNo,r-234), (account,b-123), (unitPrice,15.25), (instrument,ibm))
scala> val trd2 = makeTrade(t2)
trd2: Option[net.debasishg.domain.trade.Trades.Trade] = Some(Trade(b-123,ibm,r-234,Singapore,15.25,400))
scala> ((((List(trd1, trd2)) ∘∘ forTrade) ∘∘ taxFees) ∘∘ enrichWith) ∘∘ netAmount
res1: List[Option[scala.math.BigDecimal]] = List(Some(3307.5000), Some(8845.0000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment