Earlier quoted context omitted.
Scala Dotty will maybe have some kind of @infix("+") def add so that if it should be used via a + b it needs the infix else it's only possible todo a.+(b) p.s. I banned scalaz and shapeless on my company so there aren't too much operator noises.
Do you ban cats too and any library of similar ilk? Just wondering, do you have your own libraries that use some of the good stuff? I can't imagine living in a world where I'm banned from using... * Traverse (do you write specialized versions for the cross product of [List, Vector, etc] x [Option, Either, etc] ?) * Validation (how do you collect errors? mutable.Buffer?) * NonEmptyList (I've written my own NonEmptyVec…
* Validation? Actually we are on HTTP so mostly a sealed trait structure is enough for us we barly use `Seq(ValidationError)` from Playframework (only class constructs that manually)
* NonEmptyList - I never came across a palce where I needed NonEmptyList?!
* never needed.
Just keep in mind other languages don't have such abstractions as well (maybe haskell has, but I don't know haskell). Some people need these high level abstractions and it's fine if you use it but most things are just syntactic sugar.
The only stupid thing is something like that:
- Future[Option[A1]] - Future[Option[A2]] ... - Future[Option[AN]]
and now I need a `case Some((a1, a2)) =>` without some magic you write a lot of boilerplate.
So a Monad is really something that would be great and probably we will evaluate if we get to use cats.
Edit: Code Snippet:
val h = (for {
ph
(ph.id, article.id)
}
h.value
yes this is something why we consider cats.