[EMAIL PROTECTED] writes:

> * import and infix declarations anywhere in a module?
> 
>   I am against this proposal.  Collecting all such declarations
>   at the head of the module is better for human readers.  Allowing
>   them anywhere would also complicate and slow down program analysis
>   that only requires module dependencies (eg. Haskell-specific `make'
>   tools).

I disagree.  

   - on the first point that it's easier for human readers: surely
     it makes more sense to put the fixity declaration for an operator
     next to the definition of the operator itself?  

     And for imports, it could be really handy to put the import 
     declaration for a function next to the use of the function, 
     especially when you're only using the function temporarily (so 
     you don't forget to remove the import later!).  In fact, I
     think it would be nicer to not require import declarations at
     at all for qualified entities.

   - on the second point that it's easier for computer readers: what
     could be simpler than 'look through the whole file and pick
     out the imports'.

Other good reasons for relaxing this restriction:

   - it would simplify the grammar
   - parsing is easier

Possible drawbacks:

   - with fixities and imports at the top, it might be possible to
     resolve infix expressions during parsing.  Neither Hugs nor
     GHC nor nhc do this.

Cheers,
        Simon

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key


Reply via email to