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

GHC does global type inference, and has very sophisticated types.


My point was specifically in regard to the feasibility of omitting the types in all cases. I see types often in Haskell code, likely because the community regards that as a best practice (in contrast to Crystal).


Best practice and it's required to make certain more advanced type features work.

It's the same with Crystal. Their generics require type annotations.


In Haskell types are used a lot as documentation and to make static guarantees about the program logic, not just runtime safety. If you're only worrying about illegal operations you practically don't need signatures.


...and is a slow compiler compared to for example Go :-(


OCaml has separate compilation, a REPL, and it's very fast. None of those things is incompatible with global type inference (although particular type systems can be).


Doesn't OCaml require everything to be defined before used though?


That's a problem with Cabal, not GHC. They're working on it.




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

Search: