real world scalaz

Download Real World Scalaz

Post on 22-Nov-2014




2 download

Embed Size (px)


Real World Scalaz


  • 1. REAL WRLD SCALAZ talk title (practical scalaz by Chris Marshall
  • 2. If you are thinking of using Scalaz, stop now while you still have your sanity"* context: java devs learning scala* source:
  • 3. How does this help you ship features or improve your product?* context: commenting on the use of lenses* source:!/coda/status/167794305107361796)
  • 4. It will not immediately help you write better programs that are easy to understand* hear/read this often* source:
  • 5. There are two types of [libraries]: the ones people hate and the ones nobody uses - unknown* applies to scala too* know correct attribution? contact me
  • 6. HOW & WHY?* those quotes pretty much boil down to these two questions:* how: apply tools given by scalaz to real world problems? to handle human scale?* why would we choose this solution over other ones?
  • 7. @_jrwest* a little context before we talk about the how & why?
  • 8. I WORK @* small team, < 15 engineers* many have java bg, but not all, most w/ little to no scala experience* most have oop bg, varying knowledge of FP topics
  • 9. WE USE SCALA { a lot }* 15+ public facing services supported by many other internal modules/libs* most built on netty, also I/O bound* originally java, now > 70% scala
  • 10. libraryDependencies += org.scalaz %% scalaz-core % 6.0.3* almost all our services depend on scalaz* usage levels and parts of scalaz used vary among services* blocked on upgrading to 6.0.4 b/c of binary compatibility issues
  • 12. JSON Mapping def Fi leMani def re festJS ad(jso ONR = ma n: JVa new JS nifest lue) = ONR[ Ap NoId.a p I D= > F field( pplyJS ileMan jsonMa O N( ifest] f i e l d( nifest { )(json change K e y) , ) LogEnt} ryCach edJson} K e y)* lift-json-scalaz (* validationnel applicative, error accumulation = better user-facing errors & debugging* composition
  • 13. S @-@ A / State[S,A] for { mbE _ xis