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) 
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) 
| Sent: 08 February 2002 13:55
| To: 'Dean Herington'; [EMAIL PROTECTED]
| Cc: Simon Peyton-Jones
| Subject: RE: inscrutable warning
| 
| 
| 
| The warning says that the interpreter has ignored a 
| polymorphic case, since it's hard to implement.  Your program
| should still behave the same, although possibly less strictly
| than you intended.
| 
| 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 
|    case ... of { DEFAULT -> ... }
| but how it came to be, I do not know.
| 
| We may investigate further.
| 
| J
| 
| | Can someone explain the following warning?
| | 
| | -------------------------------
| | module Warning where
| | 
| | type A = IO ()
| | 
| | class CA t
| |    where a :: t -> A
| | instance CA ()
| |    where a = return
| | instance (CA t) => CA (IO t)
| |    where a = (>>= a)
| | 
| | data B = B A
| | 
| | class CB t
| |    where b :: t -> B
| | instance (CA t) => CB (IO t)
| |    where b = B . a
| | -------------------------------
| | 
| | % ghci Warning.hs
| |    ___         ___ _
| |   / _ \ /\  /\/ __(_)
| |  / /_\// /_/ / /  | |      GHC Interactive, version 5.02.2, 
| | for Haskell
| | 98.
| | / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
| | \____/\/ /_/\____/|_|      Type :? for help.
| | 
| | 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.
| | 
| | Ok, modules loaded: Warning.
| | Warning>
| | 
| | _______________________________________________
| | Glasgow-haskell-users mailing list
| | [EMAIL PROTECTED]
| | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| | 
| 
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to