[Haskell-cafe] possible bug in default module lookup scheme / or
carter.schonwald at gmail.com
Sun Jul 18 15:02:39 EDT 2010
nope, I was suggesting rather:
./A.hs has module A which has an import A.B line
./A/ has B.hs with module A.B which imports A.B.C
/C which has module A.B.C in file C.hs
I think this scenario should work ....
On Sun, Jul 18, 2010 at 2:18 PM, Anthony Cowley <acowley at seas.upenn.edu>wrote:
> On Sun, Jul 18, 2010 at 1:55 PM, Carter Schonwald
> <carter.schonwald at gmail.com> wrote:
> > I'm not sure I follow, because the toy example I'm asking about does in
> > use hierarchical module names...
> > are you proposing that a reasonable workaround in my use case is to do
> > :cd ..
> > :r
> > this seems like a reasonableish approach, or was there a different
> > you had in mind?
> Yes, that is what I had in mind. The typical scenario for me is to be
> editing a file in emacs, C-c-C-l it, and have GHCi complain. I then
> issue a ":cd .." in GHCi, and my subsequent loads are properly rooted
> at top of the project directory.
> What I was trying to describe as unwanted is for someone to take your
> toy example and, in the file A/B.hs have a line "import B.C" that is
> gets correctly resolved by GHC. I'm not sure that you were actually
> suggesting this, but this kind of leniency on the part of GHC (or
> GHCi) would make the file B.hs fragile with respect to moving it
> around on disk.
> > On Sun, Jul 18, 2010 at 1:34 PM, Anthony Cowley <acowley at seas.upenn.edu>
> > wrote:
> >> On Sun, Jul 18, 2010 at 3:59 AM, Carter Schonwald
> >> <carter.schonwald at gmail.com> wrote:
> >> > I don't think that semantics creates the sort of ambiguity that Kevin
> >> > concerned about, and while yes there simple alternative approaches,
> >> > require whatever is starting up ghci to know what the correct
> >> > to
> >> > pass to the -i flag, and that seems a bit of a heavy weight
> >> I usually use ghci's :cd command in this situation, and wouldn't want
> >> to think about changing source files depending on where they were on
> >> disk.
> >> While having to use fully hierarchical names might seem verbose, I
> >> have found it to be a very predictable mechanism that makes managing
> >> large-ish projects easier.
> >> Anthony
> >> _______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-Cafe at haskell.org
> >> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe