[Haskell-cafe] Language extensions [was: Memoization]

Henning Thielemann lemming at henning-thielemann.de
Tue May 29 06:23:54 EDT 2007


Hi Andrew!

I share your concerns about the simplicity of the language. Once
extensions exists, they are used widely, and readers of programs must
understand them, also if the extensions are used without need. I
understand the motivations for many type extensions, but library writers
tend to use language extensions instead of thinking hard how to avoid
them. At least people should separate advanced code from simple one.
  http://www.haskell.org/haskellwiki/Use_of_language_extensions
 Indeed the State monad and State monad transformer are quite simple and
fit very well into Haskell 98. The langaguage extension is only needed
because there shall be class methods like 'get' and 'put' that can be used
without modification on both the State monad and its transformer variant.
It would be easy to separate the concrete types State and StateT from the
class MonadState, but this has not been done.
 I wish the compilers would allow more fine grained switches on languages
extensions. -fglasgow-exts switches them all on, but in most cases I'm
interested only in one. Then typing errors or design flaws (like 'type
Synonym = Type', instead of wanted 'type Synonym a = Type a'; extended
instance declarations) are accepted without warnings.



On Sun, 27 May 2007, Andrew Coppin wrote:

> > Keep in mind also that many of these extensions are part of Haskell
> > Prime, which last I checked is supposed to become official sometime
> > later this year.
>
> This worries me greatly. I'm really afraid that Haskell will go from
> being this wonderful, simple language that you can explain in a page or
> two of text to being this incomprehensible mass of complex type
> machinery that I and most other human beings will never be able to learn
> or use. :-(

I hope that compilers will have a Prime switch in order to distinguish
Haskell 98 programs from Haskell' ones. This way I could reliably test,
whether my programs use simple or advanced language features.


Let me cite from the book
  "Programming in Modula-3: An Introduction in Programming with Style",
  "Conclusion / Why programming?", page 425:
 "In a lecture in March 1995 at the University of Klagenfurt, Niklaus
Wirth analyzed the phenomenon of software chaos. He challenged that the
ever rising complexity of software is not necessary, and indeed that it is
bound to the loss of certain engineering qualities, such as an
appreciation of efficiency and simplicity."


More information about the Haskell-Cafe mailing list