Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem compiling cabal on ubuntu, "Could not find module `Control.Monad'"

330 views
Skip to first unread message

Ben Crowell

unread,
Dec 24, 2008, 4:25:38 PM12/24/08
to
The packaging of cabal on ubuntu is apparently out of date and/or
broken, so I'm trying to compile it by hand. I tried this:

runghc Setup configure -p
runghc Setup build

The result is "Could not find module `Control.Monad'".

On this page
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Control
I don't find anything in the "Control" section called simply "Monad."

Any suggestions would be much appreciated.

Mark T.B. Carroll

unread,
Dec 24, 2008, 8:01:49 PM12/24/08
to
Ben Crowell <crow...@lightSPAMandISmatterEVIL.com> writes:

> runghc Setup configure -p
> runghc Setup build
>
> The result is "Could not find module `Control.Monad'".

Huh, that's a bit odd. I thought Control.Monad was part of the base
libraries, at least for ghc - see the right column on
http://www.haskell.org/ghc/docs/latest/html/libraries/

Mark

Pekka Karjalainen

unread,
Dec 25, 2008, 3:38:44 AM12/25/08
to
In article <003eb2c1$0$11610$c3e...@news.astraweb.com>, Ben Crowell wrote:
>The result is "Could not find module `Control.Monad'".
>
>On this page
>http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Control
>I don't find anything in the "Control" section called simply "Monad."
>
>Any suggestions would be much appreciated.

That's odd. Control.Monad is simply one level of the hierarchical
libraries, and it should contain a few sublibraries. I can't imagine what
would make it not work at all.

What happens if you start ghci and type the command

:m +Control.Monad

in it? It should add that module into the active modules and your ghci
prompt should look something like this:

Prelude Control.Monad>

If this doesn't work as expected, there is probably something wrong with
your ghc installation or its library paths. Since I've never come across
an error like that, I can't even guess what might cause it.

I've used the generic Linux binaries from haskell.org on Ubuntu without
any problems, by the way. Various downloads can be found via:

http://haskell.org/ghc/download.html

Basically, if you just want to make it work, starting with a fresh install
might be the quickest way. It might even be helpful to just look at how
the install scripts set up the binaries and environment variables, to make
sure there's nothing wrong with them on your system.

BR, Pekka

Ben Crowell

unread,
Dec 25, 2008, 5:21:08 PM12/25/08
to
Thanks, Mark and Pekka, for the replies :-)

Pekka Karjalainen wrote:
> In article <003eb2c1$0$11610$c3e...@news.astraweb.com>, Ben Crowell wrote:
>> The result is "Could not find module `Control.Monad'".
>>
>> On this page
>> http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Control
>> I don't find anything in the "Control" section called simply "Monad."
>>
>> Any suggestions would be much appreciated.
>
> That's odd. Control.Monad is simply one level of the hierarchical
> libraries, and it should contain a few sublibraries. I can't imagine what
> would make it not work at all.
>
> What happens if you start ghci and type the command
>
> :m +Control.Monad
>
> in it? It should add that module into the active modules and your ghci
> prompt should look something like this:
>
> Prelude Control.Monad>

$ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :m +Control.Monad
Prelude Control.Monad>

So I guess I do have the package installed, but maybe the build script
that comes with Cabal isn't properly recognizing it...?

Pekka Karjalainen

unread,
Dec 26, 2008, 7:27:12 AM12/26/08
to
In article <0058ca34$0$23791$c3e...@news.astraweb.com>, Ben Crowell wrote:
>$ ghci
>GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
>Loading package base ... linking ... done.
>Prelude> :m +Control.Monad
>Prelude Control.Monad>
>
>So I guess I do have the package installed, but maybe the build script
>that comes with Cabal isn't properly recognizing it...?

Control.Monad is actually part of the package base that comes with the
compiler. You can use the command 'ghc-pkg' to see what a given package
contains:

ghc-pkg describe <package name>

It does other useful things too, which you can easily discover from the
usage information.

I suppose you'll have to look for the problem in the build script instead.
Since I am not deeply familiar with how they work (for me, they have just
worked), I'm afraid I can't be of much help there.

Pekka

Mark T.B. Carroll

unread,
Dec 26, 2008, 11:33:34 AM12/26/08
to
Ben Crowell <crow...@lightSPAMandISmatterEVIL.com> writes:

> So I guess I do have the package installed, but maybe the build script
> that comes with Cabal isn't properly recognizing it...?

Would you be able to tell us the exact source files and ghc command line
that is causing the error, so we can try reproducing it? (Or how to
reproduce it given the source bundle?) That may help. Then if we find a
system it works on we can try figuring out how it's different to yours.
Looking at cabal-install 0.6.0 (is that what I should look at?) at
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install
I admit I'm bit intimidated by all the dependencies; I have no idea to
what extent those all tend to come with a recent GHC. I also have no
Ubuntu systems to hand.

You may also want to try asking on one of the Haskell mailing lists when
comp.lang.haskell runs a bit dry, though maybe some knowledgeable people
are simply away from here for holiday celebration things.

Admittedly, I'm in the Cabal-hating minority. (-:

Mark

0 new messages