Hacker News new | past | comments | ask | show | jobs | submit login

Sorry, now I see it - it enables better type inference. Please ignore :)



yeah, it is still a similar amount of overhead in typing


Actually it's not. Only the primitive readers have similar "overhead" as with the implicits approach. Most of the readers are defined by mapping or flatMapping over the primitives (either explicitly or with comprehensions). With the implicits approach all of the "injected" methods need to declare the dependency via the implicit parameter. With the reader approach, only the primitives have to declare it. Compare the implicits version of UserInfo to the reader version. UserRepository doesn't appear anywhere in the signatures of the reader version.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: