[Now entering our 3rd day of not being able to read email.
 I'm not too sure if this will get through - so I'm sending it
 direct to Mark as well as to hugs-bugs.]

Hi Mark,

Here's a bug and possible fix for Hugs 1.3c March 1998 patchlevel 1.

File: t007.hs

data Monad2 m = MkMonad2 (forall a. a -> m a)
                         (forall a, b. m a -> (a -> m b) -> m b)

halfListMonad  :: (forall a,b. [a] -> (a -> [b]) -> [b]) -> Monad2 []
halfListMonad b = MkMonad2 (\x -> [x]) b

Transcript:

./hugs -P../lib ~/stghugs/Tests/typechecker/t007.hs
  __   __ __  __  ____   ___     __________________________________________
  ||   || ||  || ||  || ||__     Hugs 1.3c: The Haskell User's Gofer System
  ||___|| ||__|| ||__||  __||    Copyright (c) Mark P Jones,
  ||---||         ___||          The University of Nottingham, 1994-1998.
  ||   ||                        Report bugs to [EMAIL PROTECTED]
  ||   ||    [March 1998 p1]     __________________________________________

Reading script file "../lib/Prelude.hs":
Reading script file "/home/reid/stghugs/Tests/typechecker/t007.hs":
Type checking      
INTERNAL ERROR: markType
? [Leaving Hugs]

Possible fix (add these lines to markType in subst.c):

        case RANK2     : markType(snd(snd(t)),o);
                         return;
        case POLYTYPE  : /* No need to mark generic types */
                         return;


Caveat:

This patch fixes the immediate symptoms of the bug but I'm not certain
whether it is correct (eg does it make Hugs accept programs which it
should object to?).  I'm not sure if it fixes the whole problem or 
whether we need a few more cases (eg to handle scoped type variables or
other extensions).  Probably best not to apply this patch until Mark
has commented on it - unless you really need it.

Alastair

Reply via email to