1. 23 Sep, 2006 1 commit
  2. 21 Sep, 2006 1 commit
  3. 20 Sep, 2006 25 commits
    • chak@cse.unsw.edu.au.'s avatar
      Adding FamInstEnv & FamInst modules · 91923f12
      chak@cse.unsw.edu.au. authored
      - They got lost during manual patching, as they are file additions.
      91923f12
    • chak@cse.unsw.edu.au.'s avatar
      Fix type checking of imported data instances · 6070e794
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:48:41 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Fix type checking of imported data instances
        Mon Sep 11 20:06:51 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Fix type checking of imported data instances
          - When reading a data/newtype instance from an interface, the data constructors
            have their own universals that do not necessarily match up with their tycon's
            type parameters.  (Whereas when type checking source, they are always the 
            same.)
          - Hence, we need to be careful when building the wrapper signature of imported
            data constructors from data/newtype instances, and rename the type variables
            in the instance types appropriately.
      6070e794
    • chak@cse.unsw.edu.au.'s avatar
      Get of fam inst index in ifaces · 0cb269be
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:40:42 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Get of fam inst index in ifaces
        Fri Sep  8 16:31:26 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Get of fam inst index in ifaces
          - Removes the explicit index to get unique names for derived tycons for family
            instances again, following a suggestion by SPJ.
          - We now derive the coercion tycon name from the name of the representation 
            tycon, which is in the iface anyways.
          
          *** WARNING: Change of interface file format! ***
          ***          Recompile from scratch!          ***
      0cb269be
    • chak@cse.unsw.edu.au.'s avatar
      Straightened out implicit coercions for indexed types · d76c18e0
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:35:24 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Straightened out implicit coercions for indexed types
        Mon Sep  4 23:46:14 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Straightened out implicit coercions for indexed types
          - HscTypes.implicitTyThings and LoadIface.ifaceDeclSubBndrs now
            include the coercion of indexed data/newtypes.
          - Name generation for the internal names of indexed data/newtypes now uses
            the same counter that generates the dfun unique indexes (ie, class and type
            instances are counted with the one counter).  We could make this two 
            separate counters if that's what's preferred.
          - The unique index of a data/newtype instances needs to go into the iface, so
            that we can generate the same names on slurping in the iface as when the
            original module was generated.  This is a bit yucky, but I don't see a way
            to avoid that (other than putting the full blown internal tycon name and 
            coercion name into the iface, which IMHO would be worse).
          - The predicate for when a datacon has a wrapper didn't take GADT
            equations nor whether it comes froma  family instance into account.
          
          *** WARNING!  This patch changed the interface file format. ***
          ***           Please recompile from scratch.                ***
      d76c18e0
    • chak@cse.unsw.edu.au.'s avatar
      Indexed newtypes · 27897431
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:24:27 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Indexed newtypes
        Thu Aug 31 22:09:21 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Indexed newtypes
          - This patch makes indexed newtypes work
          - Only lightly tested
          - We need to distinguish between open and closed newtypes in a number of 
            places, because looking through newtypes doesn't work easily for open ones.
      27897431
    • chak@cse.unsw.edu.au.'s avatar
      Check category of type instances and some newtype family fixes · d5c4754d
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:23:39 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Check category of type instances and some newtype family fixes
        Thu Aug 31 16:54:14 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Check category of type instances and some newtype family fixes
      d5c4754d
    • chak@cse.unsw.edu.au.'s avatar
      Checking conformance of AT indexes with instance heads · 53569e14
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:18:18 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Checking conformance of AT indexes with instance heads
        Wed Aug 30 20:13:52 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Checking conformance of AT indexes with instance heads
      53569e14
    • chak@cse.unsw.edu.au.'s avatar
      Check that AT instance is in a class · feb584b7
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:16:40 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Check that AT instance is in a class
        Sat Aug 26 21:49:56 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Check that AT instance is in a class
      feb584b7
    • chak@cse.unsw.edu.au.'s avatar
      Fixed bug in coercion for indexed data types · a7a32655
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:12:51 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Fixed bug in coercion for indexed data types
        Fri Aug 25 16:45:29 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Fixed bug in coercion for indexed data types
          - Significant examples are starting to work; eg, generic finite maps:
          
          class GMapKey k where
            data GMap k :: * -> *
            empty       :: GMap k v
            lookup      :: k -> GMap k v -> Maybe v
            insert      :: k -> v -> GMap k v -> GMap k v
          
          instance GMapKey Int where
            data GMap Int v        = GMapInt (Map.Map Int v)
            empty                  = GMapInt Map.empty
            lookup k (GMapInt m)   = Map.lookup k m
            insert k v (GMapInt m) = GMapInt (Map.insert k v m)
          
          instance GMapKey Char where
            data GMap Char v        = GMapChar (GMap Int v)
            empty                   = GMapChar empty
            lookup k (GMapChar m)   = lookup (ord k) m
            insert k v (GMapChar m) = GMapChar (insert (ord k) v m)
          
          instance GMapKey () where
            data GMap () v           = GMapUnit (Maybe v)
            empty                    = GMapUnit Nothing
            lookup () (GMapUnit v)   = v
            insert () v (GMapUnit _) = GMapUnit $ Just v
          
          instance (GMapKey a, GMapKey b) => GMapKey (a, b) where
            data GMap (a, b) v            = GMapPair (GMap a (GMap b v))
            empty		                = GMapPair empty
            lookup (a, b) (GMapPair gm)   = lookup a gm >>= lookup b 
            insert (a, b) v (GMapPair gm) = GMapPair $ case lookup a gm of
          				    Nothing  -> insert a (insert b v empty) gm
          				    Just gm2 -> insert a (insert b v gm2  ) gm
          
          instance (GMapKey a, GMapKey b) => GMapKey (Either a b) where
            data GMap (Either a b) v                = GMapEither (GMap a v) (GMap b v)
            empty                                   = GMapEither empty empty
            lookup (Left  a) (GMapEither gm1  _gm2) = lookup a gm1
            lookup (Right b) (GMapEither _gm1 gm2 ) = lookup b gm2
            insert (Left  a) v (GMapEither gm1 gm2) = GMapEither (insert a v gm1) gm2
            insert (Right a) v (GMapEither gm1 gm2) = GMapEither gm1 (insert a v gm2)
          
      a7a32655
    • chak@cse.unsw.edu.au.'s avatar
      Pattern matching of indexed data types · 6791ad22
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:11:24 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Pattern matching of indexed data types
        Thu Aug 24 14:17:44 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Pattern matching of indexed data types
          - This patch is the last major puzzle piece to type check and desugar indexed 
            data types (both toplevel and associated with a class).
          - However, it needs more testing - esp wrt to accumlating CoPats - and some 
            static sanity checks for data instance declarations are still missing.
          - There are now two detailed notes in MkIds and TcPat on how the worker/wrapper
            and coercion story for indexed data types works.
      6791ad22
    • chak@cse.unsw.edu.au.'s avatar
      Introduce coercions for data instance decls · 909d2dd8
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:07:30 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Introduce coercions for data instance decls
        Tue Aug 22 20:33:46 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Introduce coercions for data instance decls
          - data instance declarations implicitly generate a coercion moving between the
            representation type and family instance type.
          - The coercion is *implicitly* generated when type checking both source and 
            ifaces.  Ie, we don't safe it in ifaces - this is really exactly as newtype 
            coercions are handled.
          - The previous addition of the instance types to DataCons has been moved to 
            the representation TyCon.  This is more efficient as it is shared between all
            constructors of one representation tycon and it also gathers everything about
            data instances (family tycon, instance types, and coercion) in one place: the
            algTcParent field of TyCon.
          - The coercion is already used in the datacon wrappers, but not yet during type
            checking pattern matching of indexed data types.
          - The code has only been lightly tested, but doesn't seem to break features not
            related to indexed types.  For indexed data types only the pattern matching
            tc code (in TcPat.tcConPat) and some well-formedness checks are still 
            missing.  And there will surely be some bugs to fix.  (newtypes still require
            some more work.)
          
          	   ** WARNING: Interface file format changed! **
          	   **          Recompile from scratch!        **
      909d2dd8
    • chak@cse.unsw.edu.au.'s avatar
      Extend TyCons and DataCons to represent data instance decls · 80c89b80
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 19:05:18 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Extend TyCons and DataCons to represent data instance decls
        Fri Aug 18 19:11:37 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Extend TyCons and DataCons to represent data instance decls
          - This is a faily involved patch, but it is not entirely complete:
            + The data con wrapper code for instance data cons needs to apply the
              coercions (which we still have to generate).
            + There are still bugs, but it doesn't seem to affect the compilation of
              code that doesn't use type families.
          
          ** WARNING: Yet another change of the iface format.  **
          **          Recompile everything.                    **
      80c89b80
    • chak@cse.unsw.edu.au.'s avatar
      Extend Class.Class to include the TyCons of ATs · bb106f28
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 18:58:51 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Extend Class.Class to include the TyCons of ATs
        Wed Aug 16 16:15:31 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Extend Class.Class to include the TyCons of ATs
      bb106f28
    • chak@cse.unsw.edu.au.'s avatar
      Extended TyCon and friends to represent family declarations · e8a591c1
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 18:50:35 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Extended TyCon and friends to represent family declarations
        Tue Aug 15 16:52:31 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Extended TyCon and friends to represent family declarations
      e8a591c1
    • 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
      Make newtype Coercion eta-contract if the tails of lhs and rhs match up · fadef64b
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 17:20:17 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Make newtype Coercion eta-contract if the tails of lhs and rhs match up
        Sun Aug  6 20:57:10 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Make newtype Coercion eta-contract if the tails of lhs and rhs match up
          Thu Aug  3 12:26:52 EDT 2006  kevind@bu.edu
      fadef64b
    • chak@cse.unsw.edu.au.'s avatar
      Flip direction of newtype coercions, fix some comments · 5e0ea427
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 17:19:19 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Flip direction of newtype coercions, fix some comments
        Sun Aug  6 20:56:23 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Flip direction of newtype coercions, fix some comments
          Thu Aug  3 10:53:37 EDT 2006  kevind@bu.edu
      5e0ea427
    • chak@cse.unsw.edu.au.'s avatar
      Make sym coercion smart constructor smarter, add comments · a7bda9e6
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 17:11:59 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Make sym coercion smart constructor smarter, add comments
        Sun Aug  6 20:32:58 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Make sym coercion smart constructor smarter, add comments
          Tue Aug  1 11:30:14 EDT 2006  kevind@bu.edu
      a7bda9e6
    • chak@cse.unsw.edu.au.'s avatar
      Fix GADT refinement fix-pointing, add ASSERTs and a WARN, make type equality... · 67ee8a93
      chak@cse.unsw.edu.au. authored
      Fix GADT refinement fix-pointing, add ASSERTs and a WARN, make type equality functions work for PredTy Eqtype ...
      Mon Sep 18 17:07:38 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Fix GADT refinement fix-pointing, add ASSERTs and a WARN, make type equality functions work for PredTy Eqtype ...
        Sun Aug  6 20:28:50 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Fix GADT refinement fix-pointing, add ASSERTs and a WARN, make type equality functions work for PredTy Eqtype ...
          Tue Aug  1 06:14:43 EDT 2006  kevind@bu.edu
      67ee8a93
    • 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
    • chak@cse.unsw.edu.au.'s avatar
      fix some coercion kind representation things, extend exprIsConApp_maybe to non-vanilla · 6fcf9006
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 14:51:33 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * fix some coercion kind representation things, extend exprIsConApp_maybe to non-vanilla
        Sat Aug  5 21:48:21 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * fix some coercion kind representation things, extend exprIsConApp_maybe to non-vanilla
          Wed Jul 19 08:06:28 EDT 2006  kevind@bu.edu
      6fcf9006
    • chak@cse.unsw.edu.au.'s avatar
      towards unboxing through newtypes · a4c34367
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 14:44:50 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * towards unboxing through newtypes
        Sat Aug  5 21:42:05 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * towards unboxing through newtypes
          Fri Jul 14 12:02:32 EDT 2006  kevind@bu.edu
      a4c34367
    • chak@cse.unsw.edu.au.'s avatar
      Complete the evidence generation for GADTs · 15cb792d
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 14:43:22 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Complete the evidence generation for GADTs
        Sat Aug  5 21:39:51 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * Complete the evidence generation for GADTs
          Thu Jul 13 17:18:07 EDT 2006  simonpj@microsoft.com
            
            This patch completes FC evidence generation for GADTs.
            
            It doesn't work properly yet, because part of the compiler thinks
            	(t1 :=: t2) => t3
            is represented with FunTy/PredTy, while the rest thinks it's represented
            using ForAllTy.  Once that's done things should start to work.
      15cb792d
    • chak@cse.unsw.edu.au.'s avatar
      newtype fixes, coercions for non-recursive newtypes now optional · c94408e5
      chak@cse.unsw.edu.au. authored
      Mon Sep 18 14:24:27 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * newtype fixes, coercions for non-recursive newtypes now optional
        Sat Aug  5 21:19:58 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
          * newtype fixes, coercions for non-recursive newtypes now optional
          Fri Jul  7 06:11:48 EDT 2006  kevind@bu.edu
      c94408e5
  4. 18 Sep, 2006 2 commits
    • 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
    • chak@cse.unsw.edu.au.'s avatar
      Partial changes for derived newtype instances · 5653634e
      chak@cse.unsw.edu.au. authored
      Sat Aug  5 21:16:57 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
        * Partial changes for derived newtype instances
        Fri Jul  7 05:45:15 EDT 2006  simonpj@microsoft.com
      5653634e
  5. 07 Aug, 2006 2 commits
  6. 06 Aug, 2006 4 commits
  7. 04 Aug, 2006 1 commit
  8. 18 Sep, 2006 1 commit
  9. 18 Aug, 2006 1 commit
  10. 15 Aug, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Reject derivable type classes with higher-rank methods · 4bcaad0c
      simonpj@microsoft.com authored
      Trac #864 suggested a derivable type class with a higher-rank method.
      
      In principle this is quite do-able, but in practice the mechanism works
      by generating source code and then doing type inference.  To make this work
      with higher-rank types would require impredicative polymorphism. And we 
      do have that, so it could probably be made to work by generating (source-level)
      type annotations.  But it's real work, so I'm settling for generating a
      decent error message rather than crashing.
      
      4bcaad0c
  11. 28 Jul, 2006 1 commit