RE: Error Interpreting Main with API

2008-04-22 Thread Simon Peyton-Jones
| > The GHC API is behaving just like --make: it links the program if you
| > have a Main module.  To ask it not to link, you want to do the same as
| > '--make -c', which in the GHC API means setting the ghcLink field of
| > DynFlags to NoLink.
|
| Thanks, this has solved the problem I was having. I wonder whether it
| would be a good idea to amend the Wiki page to relect this? I think it is
| reasonable to assume that other users are going to want to use the API
| against Main modules and it's possibly not too clear at the moment how to
| do this.

Yes I do, please!  Would you feel up to doing so?  I'm sure Simon'd check your 
text for veracity!

thanks

Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Error Interpreting Main with API

2008-04-22 Thread C.M.Brown
Hi Simon,

> Yes I do, please!  Would you feel up to doing so?  I'm sure Simon'd check 
> your text for veracity!

I have modified the wiki, and added a new section under "initialisation":
http://www.haskell.org/haskellwiki/GHC/As_a_library

Would it also be appropriate to modify that wiki page to reflect some of
the changes between 6.6.1 and 6.8.2? I don't mind doing this at some point
today or tomorrow...

Regards,
Chris.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Error Interpreting Main with API

2008-04-22 Thread Simon Peyton-Jones
| Would it also be appropriate to modify that wiki page to reflect some of
| the changes between 6.6.1 and 6.8.2? I don't mind doing this at some point
| today or tomorrow...

Yes please, that would be vv helpful.

S
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


instance export decls

2008-04-22 Thread Serge D. Mechveliani
Dear GHC developers, people,

Do you agree that there exists such a problem for a programmer as 
recalling exported instances?
Have Haskell and/or GHC some constructs and tools to help the programmer 
to recall the exported instances for a module? 
Could GHC support the instance export messages for each module?

In Haskell-98, the exported instances cannot be named explicitly in the
export list.
Right?
But for easier understanding of a program, it is desirable to allow to 
name (in a short form) instances in the export list. 
For this reason, I add comments, and write the export like this:

  module Poly 
  (WithHead(..), WithTail(..), -- classes
   Mon(..), Polynomial(..),
   lc, polMons
   -- , instances
   -- for Mon: WithHead, List;
   -- for Polynomial:  WithHead, Cast Polynomial Mon  
  )
The comment of kind  "-- , instances ..."   
helps to recall which instances are exported, without inspecting all 
the (lengthy) module source. 

But when the programmer changes the source, one often forgets to 
add/remove the needed comments about instances.
I often forget them (maybe, lazy to recall) when I move pieces of code 
between modules.

So, I suggest the following feature for GHC.

1. To allow the export declarations of kind   instance {}
   (maybe to suggest this for Haskell ?)
2. If the module under compilation has the word `instance' in its 
   export list,  
   then  ghc  finds the difference set  diff  for the exported instance 
   kinds  eKinds  and the instance kinds  nKinds  named in the export
   list. If  not $ null diff,  it issues the message:
   "Warning:  the exported instance kinds and the instance kinds named 
  in the export differ in the following items: ...".

Seeing such a message, the user corrects the export list in the source 
according to  diff.

For the export list and for their messages, it is probably better to 
use a short denotation: the instance kind rather than full instance 
declaration. In the instance kind, the part of "(...) =>" is skipped.

What people think of this suggestion?

Thank you in advance for your notes and help,

-
Serge Mechveliani
[EMAIL PROTECTED]




  
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users