1. 02 Feb, 2009 1 commit
  2. 26 Nov, 2008 1 commit
  3. 31 Jul, 2008 1 commit
  4. 04 Aug, 2008 1 commit
  5. 12 Apr, 2008 1 commit
  6. 15 Mar, 2008 1 commit
  7. 26 Jan, 2008 1 commit
  8. 07 Jan, 2008 1 commit
    • simonpj@microsoft.com's avatar
      Make the treatment of equalities more uniform · 3787d987
      simonpj@microsoft.com authored
      This patch (which is part of the fix for Trac #2018) makes coercion variables
      be handled more uniformly.  Generally, they are treated like dictionaries
      in the type checker, not like type variables, but in a couple of places we
      were treating them like type variables.  Also when zonking we should use
      zonkDictBndr not zonkIdBndr.
      3787d987
  9. 11 Sep, 2007 1 commit
  10. 07 Sep, 2007 1 commit
  11. 04 Sep, 2007 1 commit
  12. 03 Sep, 2007 1 commit
  13. 01 Sep, 2007 1 commit
  14. 25 Jun, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Print infix type constructors in an infix way · b15724ad
      simonpj@microsoft.com authored
      Fixes Trac #1425.  The printer for types doesn't know about fixities.
      (It could be educated to know, but it doesn't at the moment.)  So it
      treats all infix tycons as of precedence less than application and function
      arrrow.
      
      I took a slight shortcut and reused function-arrow prededence, so I think
      you may get
      	T -> T :% T
      meaning
      	T -> (T :% T)
      
      If that becomes a problem we can fix it.
      b15724ad
  15. 11 Jan, 2007 1 commit
  16. 29 Dec, 2006 1 commit
  17. 10 Nov, 2006 1 commit
  18. 13 Oct, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Add assertion checks for mkCoVar/mkTyVar · ac704fca
      simonpj@microsoft.com authored
      A type variable has a flag saying whether it is a *type* variable or
      a *coercion* variable.  This patch adds assertions to check the flag.
      
      And it adds fixes to places which were Wrong (and hence fired the
      assertion)! 
      
      Also removed isCoVar from Coercion, since it's done by Var.isCoVar.
      
      
      ac704fca
  19. 11 Oct, 2006 2 commits
    • Simon Marlow's avatar
      ab22f4e6
    • Simon Marlow's avatar
      Interface file optimisation and removal of nameParent · b00b5bc0
      Simon Marlow authored
      This large commit combines several interrelated changes:
      
        - IfaceSyn now contains actual Names rather than the special
          IfaceExtName type.  The binary interface file contains
          a symbol table of Names, where each entry is a (package,
          ModuleName, OccName) triple.  Names in the IfaceSyn point
          to entries in the symbol table.
      
          This reduces the size of interface files, which should
          hopefully improve performance (not measured yet).
      
          The toIfaceXXX functions now do not need to pass around
          a function from Name -> IfaceExtName, which makes that
          code simpler.
      
        - Names now do not point directly to their parents, and the
          nameParent operation has gone away.  It turned out to be hard to
          keep this information consistent in practice, and the parent info
          was only valid in some Names.  Instead we made the following
          changes:
      
          * ImportAvails contains a new field 
                imp_parent :: NameEnv AvailInfo
            which gives the family info for any Name in scope, and
            is used by the renamer when renaming export lists, amongst
            other things.  This info is thrown away after renaming.
      
          * The mi_ver_fn field of ModIface now maps to
            (OccName,Version) instead of just Version, where the
            OccName is the parent name.  This mapping is used when
            constructing the usage info for dependent modules.
            There may be entries in mi_ver_fn for things that are not in
            scope, whereas imp_parent only deals with in-scope things.
      
          * The md_exports field of ModDetails now contains
            [AvailInfo] rather than NameSet.  This gives us
            family info for the exported names of a module.
      
      Also:
      
         - ifaceDeclSubBinders moved to IfaceSyn (seems like the
           right place for it).
      
         - heavily refactored renaming of import/export lists.
      
         - Unfortunately external core is now broken, as it relied on
           IfaceSyn.  It requires some attention.
      b00b5bc0
  20. 29 Sep, 2006 1 commit
  21. 14 Sep, 2006 1 commit
  22. 23 Sep, 2006 2 commits
  23. 21 Sep, 2006 1 commit
  24. 20 Sep, 2006 3 commits
    • chak@cse.unsw.edu.au.'s avatar
      Comments only · 4c658451
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 17:43:31 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Comments only
        Wed Aug  9 04:45:19 EDT 2006  simonpj@microsoft.com
          * Comments only
      4c658451
    • chak@cse.unsw.edu.au.'s avatar
      Comments only · bda859ad
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 16:43:36 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Comments only
        Sun Aug  6 17:18:44 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Comments only
          Tue Jul 25 12:06:00 EDT 2006  simonpj@microsoft.com
      bda859ad
    • chak@cse.unsw.edu.au.'s avatar
      fix bugs, add boolean flag to identify coercion variables · 0b86bc9b
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 16:41:32 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * fix bugs, add boolean flag to identify coercion variables
        Sun Aug  6 17:04:02 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * fix bugs, add boolean flag to identify coercion variables
          Tue Jul 25 06:20:05 EDT 2006  kevind@bu.edu
      0b86bc9b
  25. 18 Sep, 2006 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Remove argument variance info of tycons · 3e0b6b25
      chak@cse.unsw.edu.au. authored
      Fri Aug 11 13:53:24 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Remove argument variance info of tycons
        - Following SPJ's suggestion, this patch removes the variance information from
          type constructors.  This information was computed, but never used.
        
        ** WARNING: This patch changes the format of interface files **
        **          You will need to rebuild from scratch.           **
      3e0b6b25
  26. 04 Aug, 2006 1 commit
  27. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  28. 06 Jan, 2006 1 commit
    • simonmar's avatar
      [project @ 2006-01-06 16:30:17 by simonmar] · 9d7da331
      simonmar authored
      Add support for UTF-8 source files
      
      GHC finally has support for full Unicode in source files.  Source
      files are now assumed to be UTF-8 encoded, and the full range of
      Unicode characters can be used, with classifications recognised using
      the implementation from Data.Char.  This incedentally means that only
      the stage2 compiler will recognise Unicode in source files, because I
      was too lazy to port the unicode classifier code into libcompat.
      
      Additionally, the following synonyms for keywords are now recognised:
      
        forall symbol 	(U+2200)	forall
        right arrow   	(U+2192)	->
        left arrow   		(U+2190)	<-
        horizontal ellipsis 	(U+22EF)	..
      
      there are probably more things we could add here.
      
      This will break some source files if Latin-1 characters are being used.
      In most cases this should result in a UTF-8 decoding error.  Later on
      if we want to support more encodings (perhaps with a pragma to specify
      the encoding), I plan to do it by recoding into UTF-8 before parsing.
      
      Internally, there were some pretty big changes:
      
        - FastStrings are now stored in UTF-8
      
        - Z-encoding has been moved right to the back end.  Previously we
          used to Z-encode every identifier on the way in for simplicity,
          and only decode when we needed to show something to the user.
          Instead, we now keep every string in its UTF-8 encoding, and
          Z-encode right before printing it out.  To avoid Z-encoding the
          same string multiple times, the Z-encoding is cached inside the
          FastString the first time it is requested.
      
          This speeds up the compiler - I've measured some definite
          improvement in parsing at least, and I expect compilations overall
          to be faster too.  It also cleans up a lot of cruft from the
          OccName interface.  Z-encoding is nicely hidden inside the
          Outputable instance for Names & OccNames now.
      
        - StringBuffers are UTF-8 too, and are now represented as
          ForeignPtrs.
      
        - I've put together some test cases, not by any means exhaustive,
          but there are some interesting UTF-8 decoding error cases that
          aren't obvious.  Also, take a look at unicode001.hs for a demo.
      9d7da331
  29. 16 Nov, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-11-16 12:55:58 by simonpj] · cdea9949
      simonpj authored
      Two significant changes to the representation of types
      
      1. Change the representation of type synonyms
      
          Up to now, type synonym applications have been held in
          *both* expanded *and* un-expanded form.  Unfortunately, this
          has exponential (!) behaviour when type synonyms are deeply
          nested.  E.g.
      	    type P a b = (a,b)
      	    f :: P a (P b (P c (P d e)))
          
          This showed up in a program of Joel Reymont, now immortalised
          as typecheck/should_compile/syn-perf.hs
      
          So now synonyms are held as ordinary TyConApps, and expanded
          only on demand.  
      
          SynNote has disappeared altogether, so the only remaining TyNote
          is a FTVNote.  I'm not sure if it's even useful.
      
      2. Eta-reduce newtypes
      
          See the Note [Newtype eta] in TyCon.lhs
          
          If we have 
      	    newtype T a b = MkT (S a b)
          
          then, in Core land, we would like S = T, even though the application
          of T is then not saturated. This commit eta-reduces T's RHS, and
          keeps that inside the TyCon (in nt_etad_rhs).  Result is that 
          coreEqType can be simpler, and has less need of expanding newtypes.
      cdea9949
  30. 15 Nov, 2005 1 commit
  31. 31 Mar, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-03-31 10:16:33 by simonmar] · 853e20a3
      simonmar authored
      Tweaks to get the GHC sources through Haddock.  Doesn't quite work
      yet, because Haddock complains about the recursive modules.  Haddock
      needs to understand SOURCE imports (it can probably just ignore them
      as a first attempt).
      853e20a3
  32. 25 Feb, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-02-25 13:06:31 by simonpj] · 8e67f550
      simonpj authored
      ---------------------------------------------
      Type signatures are no longer instantiated with skolem constants
      	---------------------------------------------
      
      	Merge to STABLE
      
      Consider
      
        p :: a
        q :: b
        (p,q,r) = (r,r,p)
      
      Here, 'a' and 'b' end up being the same, because they are both bound
      to the type for 'r', which is just a meta type variable.  So 'a' and 'b'
      can't be skolems.
      
      Sigh.  This commit goes back to an earlier way of doing things, by
      arranging that type signatures get instantiated with *meta* type
      variables; then at the end we must check that they have not been
      unified with types, nor with each other.
      
      This is a real bore.  I had to do quite a bit of related fiddling around
      to make error messages come out right.  Improved one or two.
      
      Also a small unrelated fix to make
      	:i (:+)
      print with parens in ghci.  Sorry this got mixed up in the same commit.
      8e67f550
  33. 09 Nov, 2004 1 commit
  34. 01 Oct, 2004 2 commits
    • simonpj's avatar
      [project @ 2004-10-01 13:42:04 by simonpj] · 837824d2
      simonpj authored
      ------------------------------------
      	Simplify the treatment of newtypes
      	Complete hi-boot file consistency checking
      	------------------------------------
      
      In the representation of types, newtypes used to have a special constructor
      all to themselves, very like TyConApp, called NewTcApp.    The trouble is
      that means we have to *know* when a newtype is a newtype, and in an hi-boot
      context we may not -- the data type might be declared as
      	data T
      in the hi-boot file, but as
      	newtype T = ...
      in the source file.  In GHCi, which accumulates stuff from multiple compiles,
      this makes a difference.
      
      So I've nuked NewTcApp.  Newtypes are represented using TyConApps again. This
      turned out to reduce the total amount of code, and simplify the Type data type,
      which is all to the good.
      
      
      This commit also fixes a few things in the hi-boot consistency checking
      stuff.
      837824d2
    • simonpj's avatar
      [project @ 2004-10-01 10:08:49 by simonpj] · da95f4a0
      simonpj authored
      -----------------------------------
      	Do simple checking on hi-boot files
      	-----------------------------------
      
      This commit arranges that, when compiling A.hs, we compare
      the types we infer with those in A.hi-boot, if the latter 
      exists.  (Or, more accurately, if anything A.hs imports in
      turn imports A.hi-boot, directly or indirectly.)
      
      This has been on the to-do list forever.
      da95f4a0
  35. 30 Sep, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-09-30 10:35:15 by simonpj] · 23f40f0e
      simonpj authored
      ------------------------------------
      	Add Generalised Algebraic Data Types
      	------------------------------------
      
      This rather big commit adds support for GADTs.  For example,
      
          data Term a where
       	  Lit :: Int -> Term Int
      	  App :: Term (a->b) -> Term a -> Term b
      	  If  :: Term Bool -> Term a -> Term a
      	  ..etc..
      
          eval :: Term a -> a
          eval (Lit i) = i
          eval (App a b) = eval a (eval b)
          eval (If p q r) | eval p    = eval q
          		    | otherwise = eval r
      
      
      Lots and lots of of related changes throughout the compiler to make
      this fit nicely.
      
      One important change, only loosely related to GADTs, is that skolem
      constants in the typechecker are genuinely immutable and constant, so
      we often get better error messages from the type checker.  See
      TcType.TcTyVarDetails.
      
      There's a new module types/Unify.lhs, which has purely-functional
      unification and matching for Type. This is used both in the typechecker
      (for type refinement of GADTs) and in Core Lint (also for type refinement).
      23f40f0e