[Haskell-cafe] Language extensions [was: Memoization]
Philippa Cowderoy
flippa at flippac.org
Sun May 27 14:20:21 EDT 2007
On Sun, 27 May 2007, Andrew Coppin wrote:
> Seriously. Haskell seems to attract weird and wonderful type system extensions
> like a 4 Tesla magnet attracts iron nails... And most of these extensions seem
> to serve no useful purpose, as far as I can determine. And yet, all nontrivial
> Haskell programs *require* the use of at least 3 language extensions. It's as
> if everyone thinks that Haskell 98 sucks so much that it can't be used for any
> useful programs. This makes me very sad. I think Haskell 98 is a wonderful
> language, and it's the language I use for almost all my stuff. I don't
> understand why people keep trying to take this small, simple, clean, elegant
> language and bolt huge, highly complex and mostly incomprehensible type system
> extensions onto it...
>
Yeah, who needed type classes anyway?
By which I mean that that's always been the way with haskell, and once you
get what the extensions do they tend to in fact be highly natural -
sometimes to the extent that people forget that they were ever an
extension (constructor classes, anyone?).
For example, GADTs let you implement monads as interpreters by defining a
datatype representing the abstract syntax tree that describes a
computation - you can't get this to type without at a minimum existential
types and for many monad operations you need the full power of GADTs to
declare a corresponding constructor.
I imagine it would never have occurred to you to try implementing a monad
that way, right? Similarly, a lot of the developments with type classes
and polymorphism have been about letting people write sufficiently general
libraries - they're driven by the demands of code that people want to
write, but often not so much by the demands of single, simple
applications.
Incidentally, Haskell 98 isn't that small a language itself - there's
plenty of sugar around.
--
flippa at flippac.org
There is no magic bullet. There are, however, plenty of bullets that
magically home in on feet when not used in exactly the right circumstances.
More information about the Haskell-Cafe
mailing list