4 ms·
GHC does global type inference, and has very sophisticated types.
by reagency 11y ago
GHC does global type inference, and has very sophisticated types.
- kibwen 11y agoMy 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).
- tel 11y agoBest practice and it's required to make certain more advanced type features work. It's the same with Crystal. Their generics require type annotations.
- Vulume 11y agoIn 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.
- agrafix 11y ago...and is a slow compiler compared to for example Go :-(
- dmbaturin 11y agoOCaml 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).
- seanmcdirmid 11y agoDoesn't OCaml require everything to be defined before used though?
- Vulume 11y agoThat's a problem with Cabal, not GHC. They're working on it.
- agrafix 11y ago...and is a slow compiler compared to for example Go :-(