RE: [Haskell] Module system question

2007-10-17 Thread Simon Peyton-Jones
[Moving to haskell-prime] I think there would be real merit in some reworking of the module system, especially to allow programmers to give the complete signature of a module, perhaps by expanding what the export list says. Including instances. Any such thing is very far from being a tried

Suggestion for module system (to get rid of many uses of unsafePerformIO)

2007-05-24 Thread oleg
Stephen Dolan wrote: > unsafePerformIO is possibly the most ugly feature of Haskell, yet is > necessary to do many things which should be possible without it, such > as reading configuration from a file at startup or creating global > IORefs There is a considerable debate about global mutable sta

Re: Suggestion for module system (to get rid of many uses of unsafePerformIO)

2007-05-23 Thread Adrian Hey
Stephen Dolan wrote: At the moment, we have the situation of modules using unsafePerformIO newIORef, which influences program behaviour without being referenced by main. Not really. Even with things as they currently are, if we have at the top level.. resultOfSomething = unsafePerformIO doSom

Re: Suggestion for module system (to get rid of many uses of unsafePerformIO)

2007-05-23 Thread Stephen Dolan
I think what you're describing seems to be so completely different from Haskell as it is now that that people either don't understand it, or they do understand it and do think it's downright silly, but are just too polite to say that. Maybe you should try writing it up in a more comprehensible for

Re: Suggestion for module system (to get rid of many uses of unsafePerformIO)

2007-05-23 Thread Adrian Hey
Stephen Dolan wrote: Would this be useful, useless, or just downright silly? The silence is deafening :-) I think what you're describing seems to be so completely different from Haskell as it is now that that people either don't understand it, or they do understand it and do think it's downri

Suggestion for module system (to get rid of many uses of unsafePerformIO)

2007-05-20 Thread Stephen Dolan
Ln $ show (fac val) mainFunc However, this approach does not work for modules which need to do their own initialisation with the current module system. I propose that it be legal to write things like this: MyModule.hs: fac n = product [1..n] do ref <- newIORef 42 module MyModule (ref, fac) an

Re[2]: Module System

2006-02-23 Thread Bulat Ziganshin
Hello Simon, Thursday, February 23, 2006, 2:21:22 PM, you wrote: SM>ghc --make My.Dotted.Module.hs Main.hs SM> works fine. Similarly with GHCi. i don't known that. we should add this to faq SM> It's only when GHC has to actually *find* a source file for a module SM> that the hierarchical

RE: Module System

2006-02-23 Thread Simon Marlow
On 22 February 2006 14:55, Ben Rudiak-Gould wrote: > Simon Marlow wrote: >> there's a lack of modularity in the current >> design, such that renaming the root of a module hierarchy requires >> editing every single source file in the hierarchy. The only good >> reason for this is the separation be

RE: Module System

2006-02-23 Thread Simon Marlow
On 22 February 2006 13:09, David Roundy wrote: > On Tue, Feb 21, 2006 at 03:50:29PM +, Henrik Nilsson wrote: >> I'm already somewhat unhappy about the way most present Haskell >> tools map module names to path names (I'd generally prefer to have >> the possibility to flatten my file hierarchie

Re: Module System

2006-02-23 Thread Johannes Waldmann
Georg Martius wrote: > Okay, I see the point of not including the environment into the spec. However > other languages like Java for example do this as far as I know. To be precise, no, the Java specs leave this to the implementation: JLS - 7.2. host support for packages Each host determines h

Re: Module System

2006-02-22 Thread Ben Rudiak-Gould
ace reform boils down to rules for converting partial names into canonical names. I can't see how any useful functionality in the module system could depend on a particular way of organizing code on disk. -- Ben ___ Haskell-prime mailing lis

Re: Module System

2006-02-22 Thread Henrik Nilsson
David Roundby wrote: > I'd like to second this. I've been annoyed by the fact that ghc > requires extra subdirectories in order to use hierarchical modules, > and would be doubly annoyed if the language definition declared that > this couldn't be fixed. jhc's behavior sounds nicer, but I'd rath

Re: Module System

2006-02-22 Thread Johannes Waldmann
David Roundy wrote: > DR> fixed. jhc's behavior sounds nicer, but I'd rather there were the > DR> possibility of naming our haskell files whatever we liked. Currently, as > DR> far as I can see, we can only do this with Main, and even then there are > DR> weirdnesses in ghc because Main.hi gets

Re[2]: Module System

2006-02-22 Thread bulat . ziganshin
Hello David, Wednesday, February 22, 2006, 4:09:07 PM, you wrote: DR> I'd like to second this. I've been annoyed by the fact that ghc requires DR> extra subdirectories in order to use hierarchical modules, and would be i'll be third :) i planned to fill a ticket but still not done it DR> doub

Re: Module System

2006-02-22 Thread Georg Martius
Dear all, Okay, I see the point of not including the environment into the spec. However other languages like Java for example do this as far as I know. Anyway, I would like to hear your comments about point 2-4 of my original mail, because there are more important from my point of view. These d

Re: Module System

2006-02-22 Thread David Roundy
On Tue, Feb 21, 2006 at 03:50:29PM +, Henrik Nilsson wrote: > I'm already somewhat unhappy about the way most present Haskell tools map > module names to path names (I'd generally prefer to have the possibility > to flatten my file hierarchies by, say, using dots in my file names), but > at lea

Re: Module System

2006-02-22 Thread Henrik Nilsson
Dear all, Simon M. wrote: > This is not the first time that someone has made the same suggestion > as Georg, and for good reasons: there's a lack of modularity in the > current design, such that renaming the root of a module hierarchy > requires editing every single source file in the hierarchy.

RE: Module System

2006-02-22 Thread Simon Marlow
On 21 February 2006 18:22, Henrik Nilsson wrote: > Georg wrote: > > > Well, the hierarchical module system as it is implemented today and > > how it is proposed for being included into Haskell' uses the file > > system to locate modules. > > Yes, too

Re: Module System

2006-02-21 Thread John Meacham
On Tue, Feb 21, 2006 at 03:50:29PM +, Henrik Nilsson wrote: > I'm already somewhat unhappy about the way most present Haskell tools > map module names to path names (I'd generally prefer to have the > possibility to flatten my file hierarchies by, say, using dots in > my file names), but at lea

Re: Module System

2006-02-21 Thread Henrik Nilsson
PS: > True, but do these differences matter to us? Sorry for my naivety, but > I can't see that much problems, expect very old 8.3 restrictions, but > they are history now! Here's a concrete example, then. Windows file systems don't distinguish case. Thus the two different Haskell modules "FOO

Re: Module System

2006-02-21 Thread Henrik Nilsson
Hi Georg, Georg wrote: > Well, the hierarchical module system as it is implemented today and > how it is proposed for being included into Haskell' uses the file > system to locate modules. Yes, tools need to, somehow, locate modules. Yes, for portability reasons, it is conve

Re: Module System

2006-02-21 Thread Georg Martius
Hi Henrik, On Tuesday 21 February 2006 16:50, Henrik Nilsson wrote: > Hi all, > > Georg Martius wrote: > > I have some proposals for changes of the hierarchical module system as > > it is at the moment. > > [...] > > The hierarchical name can be derived

Re: Module System

2006-02-21 Thread Henrik Nilsson
Hi all, Georg Martius wrote: > I have some proposals for changes of the hierarchical module system as > it is at the moment. > [...] > The hierarchical name can be derived from the place in the filesystem. This is not a comment about the above proposal in itself, which arguably ha

Module System

2006-02-21 Thread Georg Martius
Hello, I have some proposals for changes of the hierarchical module system as it is at the moment. Goals: - easy refactoring at Module/Package level - easier import/export of trees of modules (useful for any larger library) - relative imports/exports - deep import or export lists

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-31 Thread Johannes Waldmann
Simon Marlow wrote: >>> Perhaps 'import' should be allowed anywhere among definitions. > [...] Against: > - tools that collect imports have to parse the whole file (eg. GHC's >dependency analyser) > - can't easily see what is imported only if we keep the idea that "import" both says *that*

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Marcin 'Qrczak' Kowalczyk
"Simon Marlow" <[EMAIL PROTECTED]> writes: > on balance, I like the way it is now. An opinion to the contrary: http://www.uclic.ucl.ac.uk/harold/srf/javaspae.html "Importing packages: A brief example of design issues" -- __("< Marcin Kowalczyk \__/ [EMAIL PROTECTED] ^^

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Isaac Jones
"Simon Marlow" <[EMAIL PROTECTED]> writes: > On 30 January 2006 09:03, Simon Peyton-Jones wrote: > >>>> With the module system, we should make a distinction between >>>> declaring >>>> >>>> (1) that we want to use a modul

RE: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Simon Marlow
On 30 January 2006 09:03, Simon Peyton-Jones wrote: >>> With the module system, we should make a distinction between >>> declaring >>> >>> (1) that we want to use a module >>> (2) how to bring the module's names into scope >> >>

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Wolfgang Jeltsch
Am Montag, 30. Januar 2006 10:13 schrieb Johannes Waldmann: > [...] > I am not sure what a local fixity declaration would mean > for an operator that is defined in some outer scope. I think, it should be handled the same way a local type declaration for a variable that is defined in some outer s

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread John Meacham
On Mon, Jan 30, 2006 at 10:13:36AM +0100, Johannes Waldmann wrote: > I am not sure what a local fixity declaration would mean > for an operator that is defined in some outer scope. It would mean a whole new class of obfusciation ability for haskell programmers :) John -- John Meacham -

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Johannes Waldmann
Simon Peyton-Jones wrote: > Indeed. Requiring the import clauses to be at the top, and the fixity > declarations, makes them easy to find -- but we don't require that for > type signatures or class declarations etc. It'd be more consistent to > allow imports and fixity declarations anywhere. T

RE: module system/namespaces: separate with/use, allow local "use"

2006-01-30 Thread Simon Peyton-Jones
| > With the module system, we should make a distinction between declaring | > | > (1) that we want to use a module | > (2) how to bring the module's names into scope | | Perhaps 'import' should be allowed anywhere among definitions. Indeed. Requiring the import cl

Re: module system/namespaces: separate with/use, allow local "use"

2006-01-29 Thread Marcin 'Qrczak' Kowalczyk
Johannes Waldmann <[EMAIL PROTECTED]> writes: > With the module system, we should make a distinction between declaring > > (1) that we want to use a module > (2) how to bring the module's names into scope Perhaps 'import' should be allowed anywhere among definiti

module system/namespaces: separate with/use, allow local "use"

2006-01-25 Thread Johannes Waldmann
With the module system, we should make a distinction between declaring (1) that we want to use a module (2) how to bring the module's names into scope E. g. in Ada, there is "with" and "use", and "use" can be local, see also http://www.dcs.gla.ac.uk/mail-www/h