1. 25 Nov, 2011 1 commit
  2. 21 Nov, 2011 1 commit
    • dreixel's avatar
      Rename ? to OpenKind and ?? to ArgKind · 18c7aea0
      dreixel authored
      The previous names were not informative at all, and now we have
      named kinds like Constraint and datatype promotion to kind, so
      we might as well name these too.
      
      I tried to update some comments to the new names, but certainly
      many references to the old names remain.
      18c7aea0
  3. 16 Nov, 2011 1 commit
  4. 11 Nov, 2011 1 commit
    • dreixel's avatar
      New kind-polymorphic core · 09015be8
      dreixel authored
      This big patch implements a kind-polymorphic core for GHC. The current
      implementation focuses on making sure that all kind-monomorphic programs still
      work in the new core; it is not yet guaranteed that kind-polymorphic programs
      (using the new -XPolyKinds flag) will work.
      
      For more information, see http://haskell.org/haskellwiki/GHC/Kinds
      09015be8
  5. 04 Nov, 2011 1 commit
  6. 06 Sep, 2011 2 commits
    • batterseapower's avatar
      Implement -XConstraintKind · 9729fe7c
      batterseapower authored
      Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
      this patch adds a new kind Constraint such that:
      
        Show :: * -> Constraint
        (?x::Int) :: Constraint
        (Int ~ a) :: Constraint
      
      And you can write *any* type with kind Constraint to the left of (=>):
      even if that type is a type synonym, type variable, indexed type or so on.
      
      The following (somewhat related) changes are also made:
       1. We now box equality evidence. This is required because we want
          to give (Int ~ a) the *lifted* kind Constraint
       2. For similar reasons, implicit parameters can now only be of
          a lifted kind. (?x::Int#) => ty is now ruled out
       3. Implicit parameter constraints are now allowed in superclasses
          and instance contexts (this just falls out as OK with the new
          constraint solver)
      
      Internally the following major changes were made:
       1. There is now no PredTy in the Type data type. Instead
          GHC checks the kind of a type to figure out if it is a predicate
       2. There is now no AClass TyThing: we represent classes as TyThings
          just as a ATyCon (classes had TyCons anyway)
       3. What used to be (~) is now pretty-printed as (~#). The box
          constructor EqBox :: (a ~# b) -> (a ~ b)
       4. The type LCoercion is used internally in the constraint solver
          and type checker to represent coercions with free variables
          of type (a ~ b) rather than (a ~# b)
      9729fe7c
    • batterseapower's avatar
      6bad38a4
  7. 26 May, 2011 1 commit
    • Simon Peyton Jones's avatar
      Treat the (~) type constructor a bit specially · 3afdf90d
      Simon Peyton Jones authored
      when kind-checking in Core Lint.  It's unusual
      becuase it is poly-kinded; for example
      
      	(~) Int a
      and	(~) Maybe b
      
      are both ok.  We don't want the full generality
      of kind polymorphism (yet anyway) so these changes
      in effect give (~) its own private kinding rule.
      
      It won't work right if (~) appears un-saturated,
      and Lint now checks for that too.
      3afdf90d
  8. 19 Apr, 2011 1 commit
    • Simon Peyton Jones's avatar
      This BIG PATCH contains most of the work for the New Coercion Representation · fdf86568
      Simon Peyton Jones authored
      See the paper "Practical aspects of evidence based compilation in System FC"
      
      * Coercion becomes a data type, distinct from Type
      
      * Coercions become value-level things, rather than type-level things,
        (although the value is zero bits wide, like the State token)
        A consequence is that a coerion abstraction increases the arity by 1
        (just like a dictionary abstraction)
      
      * There is a new constructor in CoreExpr, namely Coercion, to inject
        coercions into terms
      fdf86568
  9. 04 Aug, 2006 1 commit
  10. 23 Jun, 2006 1 commit
  11. 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
  12. 11 Aug, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-08-11 08:04:33 by simonpj] · 89627230
      simonpj authored
      Do 'tidying' on Kinds before printing them.  This avoids printing
      stuff like 'k_43b' in user error messages.
      
      To do this, I ended up adding an OccName to Kind.KindVar.  Even
      then the implementation is a bit of hack (see comments with 
      Type.tidyKind).  Still, it's a highly localised hack, whereas the
      "right thing" entails making KindVar into a flavour of Var, which
      seems like an uncomfortably big change.
      
         I think this change can merge to the stable branch
      89627230
  13. 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
  14. 16 Mar, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-03-16 09:04:26 by simonpj] · ad626c24
      simonpj authored
      ```-------------------------------
       	Two GADT error-reporting bugs
      	----------------------------------
      
      	Merge to STABLE
      ```
      
      missed file...
      
      1.  Bug in kind-checking for GADTs; turned out to be in
          isOpenTypeKind on KindVars
      
      ....
      ad626c24
  15. 25 Feb, 2005 1 commit
  16. 13 Dec, 2004 1 commit
  17. 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
  18. 12 Feb, 2004 1 commit
  19. 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
      inference.
      
      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.
      f714e6b6
  20. 02 Dec, 1998 1 commit
  21. 08 Jan, 1998 1 commit
    • simonm's avatar
      [project @ 1998-01-08 18:03:08 by simonm] · 9dd6e1c2
      simonm authored
      The Great Multi-Parameter Type Classes Merge.
      
      Notes from Simon (abridged):
      
      * Multi-parameter type classes are fully implemented.
      * Error messages from the type checker should be noticeably improved
      * Warnings for unused bindings (-fwarn-unused-names)
      * many other minor bug fixes.
      
      Internally there are the following changes
      
      * Removal of Haskell 1.2 compatibility.
      * Dramatic clean-up of the PprStyle stuff.
      * The type Type has been substantially changed.
      * The dictionary for each class is represented by a new
        data type for that purpose, rather than by a tuple.
      9dd6e1c2
  22. 05 Jun, 1997 1 commit
  23. 18 May, 1997 1 commit
  24. 14 Mar, 1997 1 commit
  25. 19 Dec, 1996 1 commit
  26. 05 Jun, 1996 1 commit
  27. 16 May, 1996 1 commit
  28. 30 Apr, 1996 1 commit
  29. 08 Apr, 1996 1 commit
  30. 05 Apr, 1996 1 commit
  31. 19 Mar, 1996 1 commit