[Haskell] Annoying naming clashes

John Meacham john at repetae.net
Tue Jun 15 04:25:54 EDT 2004


On Tue, Jun 15, 2004 at 07:35:44AM +0100, Alastair Reid wrote:
> 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.]

Oh, I didn't mean to say intermediate data structures are bad, or that
they should be avoided, they are quite useful and a fundamental
technique of haskell programming. I just meant that people coming from
different backgrounds tend not to know how or even realize that they can
elide them when they are not important, which leads to a perception that
the naming problem is far worse than it actually is.

When you are creating the intermediate data structure for a reason, you
tend to come up with good unique names anyway that deal with the
algorithm or technique you are trying to express so it is less of an
issue. In fact, I find this to be a useful measure when programming, if
I really can't think of an appropriate name for a function or data
constructor, then perhaps I should rethink why I think I need it in the
first place.

It is the purely intermediate data structures that have no real
operations on them because they need not exist that are hard to name and
lead to naming conflicts. It is these structures that haskell programers
learn are not needed as their skills improve.

but yeah, I love intermediate structures as much as the next haskell
programmer :)
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell mailing list