1. 01 Apr, 2002 5 commits
    • simonpj's avatar
      [project @ 2002-04-01 08:23:30 by simonpj] · 9003a18c
      simonpj authored
      ------------------------------------
      	Change the treatment of the stupid
      	   context on data constructors
      	-----------------------------------
      
      Data types can have a context:
      
      	data (Eq a, Ord b) => T a b = T1 a b | T2 a
      
      and that makes the constructors have a context too
      (notice that T2's context is "thinned"):
      
      	T1 :: (Eq a, Ord b) => a -> b -> T a b
      	T2 :: (Eq a) => a -> T a b
      
      Furthermore, this context pops up when pattern matching
      (though GHC hasn't implemented this, but it is in H98, and
      I've fixed GHC so that it now does):
      
      	f (T2 x) = x
      gets inferred type
      	f :: Eq a => T a b -> a
      
      I say the context is "stupid" because the dictionaries passed
      are immediately discarded -- they do nothing and have no benefit.
      It's a flaw in the language.
      
      Up to now I have put this stupid context into the type of
      the "wrapper" constructors functions, T1 and T2, but that turned
      out to be jolly inconvenient for generics, and record update, and
      other functions that build values of type T (because they don't
      have suitable dictionaries available).
      
      So now I've taken the stupid context out.  I simply deal with
      it separately in the type checker on occurrences of a constructor,
      either in an expression or in a pattern.
      
      To this end
      
      * Lots of changes in DataCon, MkId
      
      * New function Inst.tcInstDataCon to instantiate a data constructor
      
      
      
      I also took the opportunity to
      
      * Rename
      	dataConId --> dataConWorkId
        for consistency.
      
      * Tidied up MkId.rebuildConArgs quite a bit, and renamed it
      	mkReboxingAlt
      
      * Add function DataCon.dataConExistentialTyVars, with the obvious meaning
      9003a18c
    • simonpj's avatar
      [project @ 2002-04-01 08:22:38 by simonpj] · 7f9f2f0a
      simonpj authored
      Comments
      7f9f2f0a
    • simonpj's avatar
      [project @ 2002-04-01 08:17:57 by simonpj] · d3601a1b
      simonpj authored
      Split out FastMutInt separately
      d3601a1b
    • simonpj's avatar
      [project @ 2002-04-01 08:17:03 by simonpj] · 0b326e7a
      simonpj authored
      Comments
      0b326e7a
    • simonpj's avatar
      [project @ 2002-04-01 08:16:49 by simonpj] · 995c2dc3
      simonpj authored
      Import wibbles
      995c2dc3
  2. 29 Mar, 2002 3 commits
  3. 28 Mar, 2002 7 commits
  4. 27 Mar, 2002 4 commits
    • simonmar's avatar
      [project @ 2002-03-27 16:48:47 by simonmar] · db50cb71
      simonmar authored
      Sigh, recompilation checking in --make mdoe has been badly broken for
      well, probably ever.
      
      The problem is that in GHCi mode there's a restriction on the use of
      object files, namely that an object file may only depend on other
      up-to-date object files in order to be up-to-date itself, because we
      don't have support for linking object code to interpreted code.
      Unfortunately we were applying this restriction to --make compilations
      too, with the result that far too much recompilation was happening.
      
      MERGE TO STABLE
      db50cb71
    • simonmar's avatar
      [project @ 2002-03-27 12:35:44 by simonmar] · 76bc2914
      simonmar authored
      Update the comment about how to add a new primop.
      76bc2914
    • simonpj's avatar
      [project @ 2002-03-27 12:09:00 by simonpj] · 95581e0c
      simonpj authored
      More validity checking, esp for existential ctxt on data cons
      95581e0c
    • simonpj's avatar
      [project @ 2002-03-27 12:07:42 by simonpj] · 0b98d0b4
      simonpj authored
      Comments and tracing only
      0b98d0b4
  5. 26 Mar, 2002 14 commits
  6. 25 Mar, 2002 6 commits
  7. 21 Mar, 2002 1 commit
    • sebc's avatar
      [project @ 2002-03-21 11:23:59 by sebc] · d182db3a
      sebc authored
      Implement Plan C, with correct code to detect the data and text
      sections for MacOS X.
      Also add a sanity check in initStorage, to make sure we are able to
      make the distinction between closures and infotables.
      d182db3a