[Haskell-cafe] Re: Design your modules for qualified import

Peter Hercek phercek at gmail.com
Sat Jun 7 09:18:03 EDT 2008

Andrew Coppin wrote:
> Until very recently, it was not at all clear to me that there is 
> actually a very simple solution to this problem:
>  import Text.ParserCombinators.Parsec as P
> Now I only have to write "P.runPaser", which is much shorter.
> This fact probably needs to be mentioned more loudly - I'm sure I'm not 
> the only person to have overlooked it...

I have one efficient way to find all the needed language
  features without reading the specification from the start to
  the end or waiting till my questions get answered. The point
  is that common sense will indicate you where the required
  features should be logically located in the language grammar.
  E.g. if you want something related to imported modules it is
  logical to check all the alternatives available in import
  declaration. Then I check the grammar how the production for
  import declaration (impdelc) looks like (where it can be used
  etc.). Mostly it is enough sometimes I need to check the
  language specification since it is not obvious from the

The result is that when I learn a new language the first thing
  I'm looking for is the formal grammar. Luckily most languages
  have it available. Some languages (like Haskell) are obsessed
  with shortcuts and the result is that their grammar is a bit
  cryptic; others (like VHDL) have it just great - production
  names clearly indicate what they actually do. On the other
  side haskell has nice online report :-)


More information about the Haskell-Cafe mailing list