1. 05 Jan, 2006 3 commits
    • simonpj's avatar
      [project @ 2006-01-05 13:10:55 by simonpj] · dd45134b
      simonpj authored
      This commit fixes a nasty problem discovered by Volker Stolz.
      The problem is described in Note [Multiple instantiation] in
      TcExpr, which is reproduced below.
      (Core Lint identifies the problem, incidentally.)
      tc200 is a test case.
      Note [Multiple instantiation]
      We are careful never to make a MethodInst that has, as its meth_id, another MethodInst.
      For example, consider
      	f :: forall a. Eq a => forall b. Ord b => a -> b
      At a call to f, at say [Int, Bool], it's tempting to translate the call to
      	f_m1 :: forall b. Ord b => Int -> b
      	f_m1 = f Int dEqInt
      	f_m2 :: Int -> Bool
      	f_m2 = f_m1 Bool dOrdBool
      But notice that f_m2 has f_m1 as its meth_id.  Now the danger is that if we do
      a tcSimplCheck with a Given f_mx :: f Int dEqInt, we may make a binding
      	f_m1 = f_mx
      But it's entirely possible that f_m2 will continue to float out, because it
      mentions no type variables.  Result, f_m1 isn't in scope.
      Here's a concrete example that does this (test tc200):
          class C a where
            f :: Eq b => b -> a -> Int
            baz :: Eq a => Int -> a -> Int
          instance C Int where
            baz = f
      Current solution: only do the "method sharing" thing for the first type/dict
      application, not for the iterated ones.  A horribly subtle point.
    • simonpj's avatar
      [project @ 2006-01-05 10:02:58 by simonpj] · 82e428eb
      simonpj authored
      'newtype' declarations are now parsed exactly like data type declarations,
      so that you can declare newtypes using GADT syntax.  But that means we
      must check all the newtype restrictions separately, and I mised one.
      This commit checks that there is no existential context on the newtype.
      Test is tcfail156
    • simonmar's avatar
      [project @ 2006-01-05 09:42:54 by simonmar] · acc7c961
      simonmar authored
      This file is not quite POSIX compliant; hopefully fix build on MacOS X
  2. 04 Jan, 2006 3 commits
  3. 03 Jan, 2006 8 commits
  4. 29 Dec, 2005 2 commits
  5. 21 Dec, 2005 1 commit
  6. 19 Dec, 2005 5 commits
  7. 16 Dec, 2005 5 commits
    • simonpj's avatar
      [project @ 2005-12-16 16:04:03 by simonpj] · 59a54a3f
      simonpj authored
      	Make deriving work for infix constructors
      	Merge to stable branch
      Back quotes were not being done correctly in deriving Read and Show.
      Now they are.  I think.
      Test is drvrun018
    • simonpj's avatar
      [project @ 2005-12-16 15:17:29 by simonpj] · 0f965da5
      simonpj authored
      Document that type variables in instance context must be distinct; merge to stable
    • simonpj's avatar
      [project @ 2005-12-16 15:15:08 by simonpj] · 4dd415e9
      simonpj authored
      	Test for repated type variables in an instance decl context;
      	this should require -fallow-undecidable-instances'
      	Merge to stable branch
    • simonmar's avatar
      [project @ 2005-12-16 11:41:51 by simonmar] · 6cfd14d1
      simonmar authored
      Avoid building the GHCi version of this lib
    • simonmar's avatar
      [project @ 2005-12-16 11:26:01 by simonmar] · 28cb5a23
      simonmar authored
      Use standard calloc rather than rolling our own.
      As a small bonus, the standard libc version is more effecient about zeroing
      the memory.
      From: Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
  8. 15 Dec, 2005 3 commits
  9. 13 Dec, 2005 8 commits
  10. 12 Dec, 2005 2 commits