[Haskell] Annoying naming clashes

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Tue Jun 15 02:35:44 EDT 2004


> [snip: parser and interpreter for a little expression language]
>
> however an experienced haskell programmer might realize the data
> structure is not needed and just write
>
> [snip: combined parser/interpreter for same language]
>
> by getting rid of these needless intermediate data structures (something
> you learn to do intuitivly as you use haskell), one reduces the chances
> for naming conflicts.

I don't think I agree with that at all.

John Hughes' "Why Functional Programming Matters" makes it very clear how much 
power you gain from adding intermediate data structures.

I personally find them extremely valuable in compilers and interpreters 
because they help me separate the concrete syntax from the abstract syntax.
Further, if the language were to evolve a little, having a separate data 
structure would make it possible to add typechecking or other static 
semantics.  

[I avoid name clashes using a combination of smallish modules, qualified 
naming and ad hoc use of prefixes and deliberate mis-spellings.  The 
situation in Haskell isn't especially happy.]

--
Alastair Reid


More information about the Haskell mailing list