Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From the specific example you're presenting, I don't see how you couldn't just have a Garnishable typeclass, that implements garnish differently for the FingerFood or Cocktail types.

The comment that FP isn't nice in the real world is pure baloney. For lots of "real world" IO-bound types of problems there is nothing better suited than a functional programming language with powerful abstractions. Things like monads let you write code in an imperative style without losing any of the benefits of writing in the functional paradigm.



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

Search: