inscrutable warning

Simon Peyton-Jones simonpj@microsoft.com
Fri, 8 Feb 2002 08:30:18 -0800


It's because there's an application of a strict function,
the dictionary selector 'a'.    In general, if f is strict
then 	f (g x)=20
is turned into
	case g x of y { DEFAULT -> f y }

But it is rather inscrutable.   It didn't arise from a strictness
annotation put in by the user.

The right thing to do is to fix the bytecode generator.

Simon

| -----Original Message-----
| From: Julian Seward (Intl Vendor)=20
| Sent: 08 February 2002 13:55
| To: 'Dean Herington'; glasgow-haskell-users@haskell.org
| Cc: Simon Peyton-Jones
| Subject: RE: inscrutable warning
|=20
|=20
|=20
| The warning says that the interpreter has ignored a=20
| polymorphic case, since it's hard to implement.  Your program
| should still behave the same, although possibly less strictly
| than you intended.
|=20
| What really mystifies us is why there is such a thing in the
| program in the first place.  Using -ddump-sat we can see that
| there is indeed a=20
|    case ... of { DEFAULT -> ... }
| but how it came to be, I do not know.
|=20
| We may investigate further.
|=20
| J
|=20
| | Can someone explain the following warning?
| |=20
| | -------------------------------
| | module Warning where
| |=20
| | type A =3D IO ()
| |=20
| | class CA t
| |    where a :: t -> A
| | instance CA ()
| |    where a =3D return
| | instance (CA t) =3D> CA (IO t)
| |    where a =3D (>>=3D a)
| |=20
| | data B =3D B A
| |=20
| | class CB t
| |    where b :: t -> B
| | instance (CA t) =3D> CB (IO t)
| |    where b =3D B . a
| | -------------------------------
| |=20
| | % ghci Warning.hs
| |    ___         ___ _
| |   / _ \ /\  /\/ __(_)
| |  / /_\// /_/ / /  | |      GHC Interactive, version 5.02.2,=20
| | for Haskell
| | 98.
| | / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
| | \____/\/ /_/\____/|_|      Type :? for help.
| |=20
| | Loading package std ... linking ... done.
| | Compiling Warning          ( Warning.hs, interpreted )
| | WARNING: ignoring polymorphic case in interpreted mode.
| |    Possibly due to strict polymorphic/functional constructor args.
| |    Your program may leak space unexpectedly.
| |=20
| | Ok, modules loaded: Warning.
| | Warning>
| |=20
| | _______________________________________________
| | Glasgow-haskell-users mailing list
| | Glasgow-haskell-users@haskell.org
| | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| |=20
|=20