1. 18 Jun, 2016 11 commits
  2. 17 Jun, 2016 4 commits
  3. 16 Jun, 2016 1 commit
  4. 15 Jun, 2016 4 commits
    • Simon Peyton Jones's avatar
      Major patch to introduce TyConBinder · e368f326
      Simon Peyton Jones authored
      Before this patch, following the TypeInType innovations,
      each TyCon had two lists:
        - tyConBinders :: [TyBinder]
        - tyConTyVars  :: [TyVar]
      
      They were in 1-1 correspondence and contained
      overlapping information.  More broadly, there were many
      places where we had to pass around this pair of lists,
      instead of a single list.
      
      This commit tidies all that up, by having just one list of
      binders in a TyCon:
      
        - tyConBinders :: [TyConBinder]
      
      The new data types look like this:
      
        Var.hs:
           data TyVarBndr tyvar vis = TvBndr tyvar vis
           data VisibilityFlag = Visible | Specified | Invisible
           type TyVarBinder = TyVarBndr TyVar VisibilityFlag
      
        TyCon.hs:
           type TyConBinder = TyVarBndr TyVar TyConBndrVis
      
           data TyConBndrVis
             = NamedTCB VisibilityFlag
             | AnonTCB
      
        TyCoRep.hs:
           data TyBinder
             = Named TyVarBinder
             | Anon Type
      
      Note that Var.TyVarBdr has moved from TyCoRep and has been
      made polymorphic in the tyvar and visiblity fields:
      
           type TyVarBinder = TyVarBndr TyVar VisibilityFlag
              -- Used in ForAllTy
           type TyConBinder = TyVarBndr TyVar TyConBndrVis
              -- Used in TyCon
      
           type IfaceForAllBndr  = TyVarBndr IfaceTvBndr VisibilityFlag
           type IfaceTyConBinder = TyVarBndr IfaceTvBndr TyConBndrVis
               -- Ditto, in interface files
      
      There are a zillion knock-on changes, but everything
      arises from these types.  It was a bit fiddly to get the
      module loops to work out right!
      
      Some smaller points
      ~~~~~~~~~~~~~~~~~~~
      * Nice new functions
          TysPrim.mkTemplateKiTyVars
          TysPrim.mkTemplateTyConBinders
        which help you make the tyvar binders for dependently-typed
        TyCons.  See comments with their definition.
      
      * The change showed up a bug in TcGenGenerics.tc_mkRepTy, where the code
        was making an assumption about the order of the kind variables in the
        kind of GHC.Generics.(:.:).  I fixed this; see TcGenGenerics.mkComp.
      e368f326
    • Simon Peyton Jones's avatar
      Re-add FunTy (big patch) · 77bb0927
      Simon Peyton Jones authored
      With TypeInType Richard combined ForAllTy and FunTy, but that was often
      awkward, and yielded little benefit becuase in practice the two were
      always treated separately.  This patch re-introduces FunTy.  Specfically
      
      * New type
          data TyVarBinder = TvBndr TyVar VisibilityFlag
        This /always/ has a TyVar it.  In many places that's just what
        what we want, so there are /lots/ of TyBinder -> TyVarBinder changes
      
      * TyBinder still exists:
          data TyBinder = Named TyVarBinder | Anon Type
      
      * data Type = ForAllTy TyVarBinder Type
                  | FunTy Type Type
                  |  ....
      
      There are a LOT of knock-on changes, but they are all routine.
      
      The Haddock submodule needs to be updated too
      77bb0927
    • Simon Peyton Jones's avatar
      Fix testsuite wibble · e33ca0e5
      Simon Peyton Jones authored
      ..in typecheck/should_run/T7861
      
      Was concealed behind the haddock perf noise
      e33ca0e5
    • Simon Peyton Jones's avatar
      Revert "Make the Ord Module independent of Unique order" · 70a45893
      Simon Peyton Jones authored
      This reverts commit 0497ee50.
      
      Reason: See Trac #12191.  I'm reverting pending Bartosz's
      investigation of what went wrong.
      70a45893
  5. 14 Jun, 2016 6 commits
  6. 13 Jun, 2016 14 commits
    • Simon Peyton Jones's avatar
      Update Haddock to follow change in LHsSigWcType · d55a9b4f
      Simon Peyton Jones authored
      Update submodule to accompany this commit:
      
          commit 15b9bf4b
          Author: Simon Peyton Jones <simonpj@microsoft.com>
          Date:   Sat Jun 11 23:49:27 2016 +0100
      
              Improve typechecking of let-bindings
      
      Sorry it's late!
      d55a9b4f
    • niteria's avatar
      Make the Ord Module independent of Unique order · 0497ee50
      niteria authored
      The `Ord Module` instance currently uses `Unique`s for comparison.
      We don't want to use the `Unique` order because it can introduce nondeterminism.
      This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic ordering
      making `Ord Module` deterministic transitively.
      
      I've run `nofib` and it doesn't make a measurable difference.
      
      See also Note [ModuleEnv determinism and performance].
      
      Test Plan:
      ./validate
      run nofib: P112
      
      Reviewers: simonpj, simonmar, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2030
      
      GHC Trac Issues: #4012
      0497ee50
    • niteria's avatar
      Use UniqFM for SigOf · 586d5581
      niteria authored
      Summary:
      The Ord instance for ModuleName is currently implemented in
      terms of Uniques causing potential determinism problems.
      I plan to change it to use the actual FastStrings and in
      preparation for that I'm switching to UniqFM where it's
      possible (you need *one* Unique per key, and you can't get
      the keys back), so that the performance doesn't suffer.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, ezyang, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2320
      
      GHC Trac Issues: #4012
      586d5581
    • niteria's avatar
      Kill unused foldModuleEnv · 7de776cf
      niteria authored
      With the current implementation, it's nondeterministic
      because Ord Module is nondeterministic.
      7de776cf
    • Tamar Christina's avatar
      Add thin library support to Windows too · 5cee88d7
      Tamar Christina authored
      Summary:
      Code already existed in the RTS to add thin library support for non-Windows
      operating systems. This adds it to Windows as well.
      
      ar thin libraries have the exact same format as normal archives except they
      have a different magic string and they don't copy the object files into the
      archive.
      
      Instead each header entry points to the location of the object file on disk.
      This is useful when a library is only created to satisfy a compile time dependency
      instead of to be distributed. This saves the time required for copying.
      
      Test Plan: ./validate and new test T11788
      
      Reviewers: austin, bgamari, simonmar, erikd
      
      Reviewed By: bgamari, simonmar
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2323
      
      GHC Trac Issues: #11788
      5cee88d7
    • Simon Peyton Jones's avatar
      A second test for Trac #12055 · 1dcb32dd
      Simon Peyton Jones authored
      This one omits the extension, thereby making GHC 8.0 produce
      "GHC internal error".
      1dcb32dd
    • Simon Peyton Jones's avatar
      Test Trac #12055 · 921ebc9f
      Simon Peyton Jones authored
      921ebc9f
    • Simon Peyton Jones's avatar
      Add to .gitignore · e064f501
      Simon Peyton Jones authored
      This adds
        *.patch
        *.stackdump    (Windows)
        foo*           (simonpj uses foo* for junk files)
      e064f501
    • Simon Peyton Jones's avatar
      Remove some traceTc calls · 8104f7c6
      Simon Peyton Jones authored
      During the kind-checking "knot" we have to be careful not
      to print too eagerly.
      8104f7c6
    • Simon Peyton Jones's avatar
      Beef up isPredTy · 599d912f
      Simon Peyton Jones authored
      isPredTy can be called on ill-kinded types, especially (of course) if
      there is a kind error.  We don't wnat it to crash, but it was, in
      piResultTy.
      
      This patch introduces piResultTy_maybe, and uses it in isPredTy.
      
      Ugh.  I dislike this code.  It's mainly used to know when we should
      print types with '=>', and we should probably have a better way to
      signal that.
      599d912f
    • Simon Peyton Jones's avatar
      Fix the in-scope set for extendTvSubstWithClone · 15fc5281
      Simon Peyton Jones authored
      We'd forgotten the variables free in the kind.
      
      Ditto extendCvSubstWithClone
      15fc5281
    • Simon Peyton Jones's avatar
      Beef up mkNakedCastTy · 1f661281
      Simon Peyton Jones authored
      By spotting Refl coercions we can avoid building an awful
      lot of CastTys.  Simple and effective.
      1f661281
    • Simon Peyton Jones's avatar
      Move the constraint-kind validity check · 35c9de7c
      Simon Peyton Jones authored
      For type synonyms, we need to check that if the RHS has
      kind Constraint, then we have -XConstraintKinds.  For
      some reason this was done in checkValidType, but it makes
      more sense to do it in checkValidTyCon.
      
      I can't remember quite why I made this change; maybe it fixes
      a Trac ticket, but if so I forget which.  But it's a modest
      improvement anyway.
      35c9de7c
    • Simon Peyton Jones's avatar
      Get in-scope set right in top_instantiate · 7afb7adf
      Simon Peyton Jones authored
      ...thereby being able to replace substThetaUnchecked
      with substTheta
      7afb7adf