1. 21 Dec, 2004 1 commit
  2. 02 Dec, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-12-02 17:18:15 by simonpj] · 759739c6
      simonpj authored
      Sorry for the fact that there are overlapping three commits in here...
      1.  Make -fno-monomorphism-restriction 
          and -fno-implicit-prelude reversible, like other flags
      2.  Fix a wibble in the new ImportAvails story, in RnNames.mkExportAvails
      3.  Fix a Template Haskell bug that meant that top-level names created
          with newName were not made properly unique.
  3. 29 Nov, 2004 1 commit
  4. 26 Nov, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-11-26 16:19:45 by simonmar] · ef5b4b14
      simonmar authored
      Further integration with the new package story.  GHC now supports
      pretty much everything in the package proposal.
        - GHC now works in terms of PackageIds (<pkg>-<version>) rather than
          just package names.  You can still specify package names without
          versions on the command line, as long as the name is unambiguous.
        - GHC understands hidden/exposed modules in a package, and will refuse
          to import a hidden module.  Also, the hidden/eposed status of packages
          is taken into account.
        - I had to remove the old package syntax from ghc-pkg, backwards
          compatibility isn't really practical.
        - All the package.conf.in files have been rewritten in the new syntax,
          and contain a complete list of modules in the package.  I've set all
          the versions to 1.0 for now - please check your package(s) and fix the
          version number & other info appropriately.
        - New options:
      	-hide-package P    sets the expose flag on package P to False
      	-ignore-package P  unregisters P for this compilation
      	For comparison, -package P sets the expose flag on package P
              to True, and also causes P to be linked in eagerly.
              -package-name is no longer officially supported.  Unofficially, it's
      	a synonym for -ignore-package, which has more or less the same effect
      	as -package-name used to.
      	Note that a package may be hidden and yet still be linked into
      	the program, by virtue of being a dependency of some other package.
      	To completely remove a package from the compiler's internal database,
              use -ignore-package.
      	The compiler will complain if any two packages in the
              transitive closure of exposed packages contain the same
      	You *must* use -ignore-package P when compiling modules for
              package P, if package P (or an older version of P) is already
              registered.  The compiler will helpfully complain if you don't.
      	The fptools build system does this.
         - Note: the Cabal library won't work yet.  It still thinks GHC uses
           the old package config syntax.
      Internal changes/cleanups:
         - The ModuleName type has gone away.  Modules are now just (a
           newtype of) FastStrings, and don't contain any package information.
           All the package-related knowledge is in DynFlags, which is passed
           down to where it is needed.
         - DynFlags manipulation has been cleaned up somewhat: there are no
           global variables holding DynFlags any more, instead the DynFlags
           are passed around properly.
         - There are a few less global variables in GHC.  Lots more are
           scheduled for removal.
         - -i is now a dynamic flag, as are all the package-related flags (but
           using them in {-# OPTIONS #-} is Officially Not Recommended).
         - make -j now appears to work under fptools/libraries/.  Probably
           wouldn't take much to get it working for a whole build.
  5. 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
          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
      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).
  6. 16 Aug, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-08-16 09:53:47 by simonpj] · 4e325538
      simonpj authored
      	Add instance information to :i
       	Get rid of the DeclPool
      1.  Add instance information to :info command.  GHCi now prints out
          which instances a type or class belongs to, when you use :i
      2.  Tidy up printing of unqualified names in user output.
          Previously Outputable.PrintUnqualified was
      	type PrintUnqualified = Name -> Bool
          but it's now
      	type PrintUnqualified = ModuleName -> OccName -> Bool
          This turns out to be tidier even for Names, and it's now also usable
          when printing IfaceSyn stuff in GHCi, eliminating a grevious hack.
      3.  On the way to doing this, Simon M had the great idea that we could
          get rid of the DeclPool holding pen, which held declarations read from
          interface files but not yet type-checked.   We do this by eagerly
          populating the TypeEnv with thunks what, when poked, do the type
          checking.   This is just a logical continuation of lazy import
          mechanism we've now had for some while.
      The InstPool and RulePool still exist, but I plan to get rid of them in
      the same way.  The new scheme does mean that more rules get sucked in than
      before, because previously the TypeEnv was used to mean "this thing was needed"
      and hence to control which rules were sucked in.  But now the TypeEnv is
      populated more eagerly => more rules get sucked in.  However this problem
      will go away when I get rid of the Inst and Rule pools.
      I should have kept these changes separate, but I didn't.  Change (1)
      affects mainly
      	TcRnDriver, HscMain, CompMan, InteractiveUI
      whereas change (3) is more wide ranging.
  7. 22 Jun, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-06-22 11:03:42 by simonpj] · 20410577
      simonpj authored
             Improve reporting of TH reify out-of-scope errors
      No change to functionality, just better error reports.
  8. 30 Dec, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-12-30 16:29:17 by simonpj] · f714e6b6
      simonpj authored
              Re-do kind inference (again)
         [WARNING: interface file binary representation has
         (as usual) changed slightly; recompile your libraries!]
      Inspired by the lambda-cube, for some time GHC has used
      	type Kind = Type
      That is, kinds were represented by the same data type as types.
      But GHC also supports unboxed types and unboxed tuples, and these
      complicate the kind system by requiring a sub-kind relationship.
      Notably, an unboxed tuple is acceptable as the *result* of a
      function but not as an *argument*.  So we have the following setup:
      		/ \
      	       /   \
      	      ??   (#)
      	     /  \
                  *   #
      where	*    [LiftedTypeKind]   means a lifted type
      	#    [UnliftedTypeKind] means an unlifted type
      	(#)  [UbxTupleKind]     means unboxed tuple
      	??   [ArgTypeKind]      is the lub of *,#
      	?    [OpenTypeKind]	means any type at all
      In particular:
        error :: forall a:?. String -> a
        (->)  :: ?? -> ? -> *
        (\(x::t) -> ...)	Here t::?? (i.e. not unboxed tuple)
      All this has beome rather difficult to accommodate with Kind=Type, so this
      commit splits the two.
        * Kind is a distinct type, defined in types/Kind.lhs
        * IfaceType.IfaceKind disappears: we just re-use Kind.Kind
        * TcUnify.unifyKind is a distinct unifier for kinds
        * TyCon no longer needs KindCon and SuperKindCon variants
        * TcUnify.zapExpectedType takes an expected Kind now, so that
          in TcPat.tcMonoPatBndr we can express that the bound variable
          must have an argTypeKind (??).
      The big change is really that kind inference is much more systematic and
      well behaved.  In particular, a kind variable can unify only with a
      "simple kind", which is built from * and (->).  This deals neatly
      with awkward questions about how we can combine sub-kinding with type
      Lots of small consequential changes, especially to the kind-checking
      plumbing in TcTyClsDecls.  (We played a bit fast and loose before, and
      now we have to be more honest, in particular about how kind inference
      works for type synonyms.  They can have kinds like (* -> #), so
      This cures two long-standing SourceForge bugs
      * 753777 (tcfail115.hs), which used erroneously to pass,
        but crashed in the code generator
            type T a = Int -> (# Int, Int #)
            f :: T a -> T a
            f t = \x -> case t x of r -> r
      * 753780 (tc167.hs), which used erroneously to fail
            f :: (->) Int# Int#
      Still, the result is not entirely satisfactory.  In particular
      * The error message from tcfail115 is pretty obscure
      * SourceForge bug 807249 (Instance match failure on openTypeKind)
        is not fixed.  Alas.
  9. 17 Nov, 2003 1 commit
  10. 03 Nov, 2003 1 commit
  11. 16 Oct, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-10-16 10:19:27 by simonpj] · 1c9f0be1
      simonpj authored
      When type-checking an interface in --make, when the source file hasn't
      changed, we must bring into scope all the things defined in the interface.
      This was breaking --make badly.
      The epicentre here is TcIface.typecheckIface
  12. 09 Oct, 2003 2 commits