[Haskell-cafe] the complex package is hidden

37 views
Skip to first unread message

bri...@aracnet.com

unread,
Sep 28, 2014, 3:55:39 PM9/28/14
to haskel...@haskell.org
Hi,

surprisingly i can't seem to google an answer to this:

Could not find module `Complex'
It is a member of the hidden package `haskell98-2.0.0.2'.
Use -v to see a list of the files searched for.

it's been quite a while since I've used ghci, and I'm just about positive I've solved this problem before, but can't seem to figure it out.

Thanks for any help.

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Tom Ellis

unread,
Sep 28, 2014, 3:59:03 PM9/28/14
to haskel...@haskell.org
On Sun, Sep 28, 2014 at 12:55:53PM -0700, bri...@aracnet.com wrote:
> surprisingly i can't seem to google an answer to this:
>
> Could not find module `Complex'
> It is a member of the hidden package `haskell98-2.0.0.2'.
> Use -v to see a list of the files searched for.

I believe `Complex` was renamed `Data.Complex`.

bri...@aracnet.com

unread,
Sep 28, 2014, 4:38:46 PM9/28/14
to haskel...@haskell.org
aha. i thought it was something like that.

But there's a bit of a weirdness.

Prelude> import Data.Complex
Prelude Data.Complex> :browse
data Complex a = !a :+ !a
cis :: RealFloat a => a -> Complex a
conjugate :: RealFloat a => Complex a -> Complex a
imagPart :: RealFloat a => Complex a -> a
magnitude :: RealFloat a => Complex a -> a
mkPolar :: RealFloat a => a -> a -> Complex a
phase :: RealFloat a => Complex a -> a
polar :: RealFloat a => Complex a -> (a, a)
realPart :: RealFloat a => Complex a -> a
Prelude Data.Complex>

So that works, but

import Data.Complex

in my code does _not_ work.

btw. ghc 7.6.1.

Thanks,

Brian

Tom Ellis

unread,
Sep 28, 2014, 4:46:34 PM9/28/14
to haskel...@haskell.org
On Sun, Sep 28, 2014 at 01:38:55PM -0700, bri...@aracnet.com wrote:
> On Sun, 28 Sep 2014 20:58:42 +0100
> Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
> > On Sun, Sep 28, 2014 at 12:55:53PM -0700, bri...@aracnet.com wrote:
> > > surprisingly i can't seem to google an answer to this:
> > >
> > > Could not find module `Complex'
> > > It is a member of the hidden package `haskell98-2.0.0.2'.
> > > Use -v to see a list of the files searched for.
> >
> > I believe `Complex` was renamed `Data.Complex`.
>
> aha. i thought it was something like that.
>
> But there's a bit of a weirdness.
>
> Prelude> import Data.Complex
> Prelude Data.Complex> :browse
> data Complex a = !a :+ !a
> cis :: RealFloat a => a -> Complex a
> conjugate :: RealFloat a => Complex a -> Complex a
> imagPart :: RealFloat a => Complex a -> a
> magnitude :: RealFloat a => Complex a -> a
> mkPolar :: RealFloat a => a -> a -> Complex a
> phase :: RealFloat a => Complex a -> a
> polar :: RealFloat a => Complex a -> (a, a)
> realPart :: RealFloat a => Complex a -> a
> Prelude Data.Complex>
>
> So that works, but
>
> import Data.Complex
>
> in my code does _not_ work.
>
> btw. ghc 7.6.1.

So what's the error message?

bri...@aracnet.com

unread,
Sep 28, 2014, 4:56:39 PM9/28/14
to haskel...@haskell.org
On Sun, 28 Sep 2014 21:46:22 +0100
Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:

> On Sun, Sep 28, 2014 at 01:38:55PM -0700, bri...@aracnet.com wrote:
> > On Sun, 28 Sep 2014 20:58:42 +0100
> > Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
> > > On Sun, Sep 28, 2014 at 12:55:53PM -0700, bri...@aracnet.com wrote:
> > > > surprisingly i can't seem to google an answer to this:
> > > >
> > > > Could not find module `Complex'
> > > > It is a member of the hidden package `haskell98-2.0.0.2'.
> > > > Use -v to see a list of the files searched for.
> > >
>
> So what's the error message?

yes. well it pays to read carefully.

once i fixed it in the top level module another module also be called had the wrong import, i didn't notice that at first, thought i had the same error. well i did, but in a different file.

all fixed and i'm good to go.

thanks for your help !

p.s. is there documentation that makes it clear that Data.Complex is required ?

I'm looking at the haskell hierarchial libraries and it's not at all obvious that Complex comes under Data. Here's the link I'm using:

http://www.haskell.org/ghc/docs/latest/html/libraries/

Brian

Tom Ellis

unread,
Sep 28, 2014, 4:59:57 PM9/28/14
to haskel...@haskell.org
On Sun, Sep 28, 2014 at 01:56:48PM -0700, bri...@aracnet.com wrote:
> On Sun, 28 Sep 2014 21:46:22 +0100
> Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
>
> > On Sun, Sep 28, 2014 at 01:38:55PM -0700, bri...@aracnet.com wrote:
> > > On Sun, 28 Sep 2014 20:58:42 +0100
> > > Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
> > > > On Sun, Sep 28, 2014 at 12:55:53PM -0700, bri...@aracnet.com wrote:
> > > > > surprisingly i can't seem to google an answer to this:
> > > > >
> > > > > Could not find module `Complex'
> > > > > It is a member of the hidden package `haskell98-2.0.0.2'.
> > > > > Use -v to see a list of the files searched for.
> > > >
> >
> > So what's the error message?
>
> yes. well it pays to read carefully.
>
> once i fixed it in the top level module another module also be called had the wrong import, i didn't notice that at first, thought i had the same error. well i did, but in a different file.
>
> all fixed and i'm good to go.
>
> thanks for your help !
>
> p.s. is there documentation that makes it clear that Data.Complex is required ?
>
> I'm looking at the haskell hierarchial libraries and it's not at all obvious that Complex comes under Data. Here's the link I'm using:
>
> http://www.haskell.org/ghc/docs/latest/html/libraries/

Glad you got it sorted!

Complex is mentioned there because it is still around for compatibility with
Haskell 98, but it's not enabled by default. You'll also see Data.Complex
in that list. Arguably there should be a warning on the page of the former
to use the latter instead.

Tom

bri...@aracnet.com

unread,
Sep 28, 2014, 5:08:21 PM9/28/14
to haskel...@haskell.org
On Sun, 28 Sep 2014 21:59:40 +0100
Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:


> Complex is mentioned there because it is still around for compatibility with
> Haskell 98, but it's not enabled by default. You'll also see Data.Complex
> in that list. Arguably there should be a warning on the page of the former
> to use the latter instead.
>

aha. i see that now.

ok. at least now i know how to fix this.

this is fairly old code, and i'm getting a lot of these sorts of things.

slowly but surely working through them :-)

thanks again.

Brian

Tom Ellis

unread,
Sep 28, 2014, 5:11:56 PM9/28/14
to haskel...@haskell.org
On Sun, Sep 28, 2014 at 02:08:30PM -0700, bri...@aracnet.com wrote:
> On Sun, 28 Sep 2014 21:59:40 +0100
> Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
> > Complex is mentioned there because it is still around for compatibility with
> > Haskell 98, but it's not enabled by default. You'll also see Data.Complex
> > in that list. Arguably there should be a warning on the page of the former
> > to use the latter instead.
>
> aha. i see that now.
>
> ok. at least now i know how to fix this.
>
> this is fairly old code, and i'm getting a lot of these sorts of things.
>
> slowly but surely working through them :-)

Depending on exactly what you are doing, you may just want to enable Haskell
98 compatibility instead.

Tom

bri...@aracnet.com

unread,
Sep 28, 2014, 5:22:48 PM9/28/14
to haskel...@haskell.org
On Sun, 28 Sep 2014 22:11:45 +0100
Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:

> On Sun, Sep 28, 2014 at 02:08:30PM -0700, bri...@aracnet.com wrote:
> > On Sun, 28 Sep 2014 21:59:40 +0100
> > Tom Ellis <tom-lists-has...@jaguarpaw.co.uk> wrote:
> > > Complex is mentioned there because it is still around for compatibility with
> > > Haskell 98, but it's not enabled by default. You'll also see Data.Complex
> > > in that list. Arguably there should be a warning on the page of the former
> > > to use the latter instead.
> >
> > aha. i see that now.
> >
> > ok. at least now i know how to fix this.
> >
> > this is fairly old code, and i'm getting a lot of these sorts of things.
> >
> > slowly but surely working through them :-)
>
> Depending on exactly what you are doing, you may just want to enable Haskell
> 98 compatibility instead.

nah. it's fine.

just a bit of Data.This and System.That.

all fixed.

didn't take long at all.

the code wasn't _that_ old :-)

Brian
Reply all
Reply to author
Forward
0 new messages