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

I'm not a fan of using -> like CoffeeScript does. It doesn't seem to mean function-body / algorithm-to-do-the-thing to me. That operator makes sense for pointers or for function return value type expressions.


I think that's just because you are used to see it used that way. And it's not like CoffeeScript invented this.

Haskell does it:

    \x -> x + 1
OCaml does it:

    fun (x : int) -> x + 1
It is very common in functional languages to use -> both for function bodies and return types.


I suppose. Kinda like => for "maps to" in some math / theory classes.




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

Search: