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

Even Rust and F#[1] don't have (generalized) do notation, what makes it remotely relevant to a decidedly non-ML-esque language like Go?

[1] Okay fine, you can fake it with enough SRTPs, but Don Syme will come and burn your house down.



IDK, Python was fine grabbing list comprehensions from Haskell, yield and coroutines from, say, Modula-2, the walrus operator from, say, C, large swaths from Smalltalk, etc. It does not matter if the languages are related; what matters is whether you can make a feature / approach fit the rest of the language.


Generalized do notation as GP is proposing requires HKT. I don't think it's controversial to say that Go will not be getting HKT.


The := is from Pascal, not C.


Afaik the F# supports do notation through computation expressions.


Like Rust, F# doesn't have higher-kinded types so it's not generalized like GP is proposing. Each type of computation expression is tied to a specific monad/applicative.


hahaha :D




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

Search: