Re: [Haskell-cafe] Haskell's type system compared to CLOS

On Tue, Aug 11, 2009 at 11:20:02PM +0100, Philippa Cowderoy wrote:
Matthias-Christian Ott wrote:
What has Haskell to provide what Common Lisp and Dylan haven't? Static typing (with inference). Very large difference, that.
That's true. This is a big advantage when compiling programmes. But as far as I know type inference is not always decidable in Haskell. Am I right? Dylan does type inference too and Hannes Mehnert is currently working on better type inference for the dylan compiler [1]. Regards, Matthias-Christian [1] https://berlin.ccc.de/wiki/Dem_Compiler_beim_Optimieren_zuschauen

Matthias-Christian Ott
That's true. This is a big advantage when compiling programmes. But as far as I know type inference is not always decidable in Haskell. Am I right?
Decidability of type inference depends on features you use (GADTs, type classes etc). Type inference in Haskell doesn't mean you avoid providing type signatures at all costs. It is good programming practice to provide type signatures, as elaborate design of ADTs, type classes you use in your program gives you possibility to encode specification of how program behaves in static, that is type signatures help you to document your code.
participants (2)
-
Matthias-Christian Ott
-
Max Desyatov