1. 01 Oct, 2019 6 commits
    • Vladislav Zavialov's avatar
      Do not rely on CUSKs in 'base' · bdba6ac2
      Vladislav Zavialov authored
      Use standalone kind signatures instead of complete user-specified kinds
      in Data.Type.Equality and Data.Typeable
      bdba6ac2
    • Takenobu Tani's avatar
      testsuite: Add minimal test for :doc command · b36dd49b
      Takenobu Tani authored
      Currently, there are no testcases for GHCi `:doc` command.
      Perhaps because it was experimental. And it could be changed in the future.
      
      But `:doc` command is already useful, so I add a minimal regression test
      to keep current behavior.
      
      See also 85309a3c for implementation of `:doc` command.
      b36dd49b
    • Sebastian Graf's avatar
    • Takenobu Tani's avatar
      Add help message for GHCi :instances command · 97811ef5
      Takenobu Tani authored
      This commit updates GHCi's help message for GHC 8.10.
      97811ef5
    • Simon Peyton Jones's avatar
      Fix arguments for unbound binders in RULE application · 6a1700aa
      Simon Peyton Jones authored
      We were failing to correctly implement Note [Unbound RULE binders]
      in Rules.hs.  In particular, when cooking up a fake Refl,
      were were failing to apply the substitition.
      
      This patch fixes that problem, and simultaneously tidies
      up the impedence mis-match between RuleSubst and TCvSubst.
      
      Thanks to Sebastian!
      6a1700aa
    • Ömer Sinan Ağacan's avatar
      Refactor iface file generation: · f3cb8c7c
      Ömer Sinan Ağacan authored
      This commit refactors interface file generation to allow information
      from the later passed (NCG, STG) to be stored in interface files.
      
      We achieve this by splitting interface file generation into two parts:
      * Partial interfaces, built based on the result of the core pipeline
      * A fully instantiated interface, which also contains the final
      fingerprints and can optionally contain information produced by the backend.
      
      This change is required by !1304 and !1530.
      
      -dynamic-too handling is refactored too: previously when generating code
      we'd branch on -dynamic-too *before* code generation, but now we do it
      after.
      
      (Original code written by @AndreasK in !1530)
      
      Performance
      ~~~~~~~~~~~
      
      Before this patch interface files where created and immediately flushed
      to disk which made space leaks impossible.
      With this change we instead use NFData to force all iface related data
      structures to avoid space leaks.
      
      In the process of refactoring it was discovered that the code in the
      ToIface Modu...
      f3cb8c7c
  2. 28 Sep, 2019 17 commits
  3. 26 Sep, 2019 1 commit
    • Ryan Scott's avatar
      Make -fbyte-code prevent unboxed tuples/sums from implying object code (#16876) · 4f81fab0
      Ryan Scott authored
      This resolves #16876 by making the explicit use of `-fbyte-code`
      prevent code that enables `UnboxedTuples` or `UnboxedSums` from
      automatically compiling to object code. This allows for a nice
      middle ground where most code that enables `UnboxedTuples`/-`Sums`
      will still benefit from automatically enabling `-fobject-code`, but
      allows power users who wish to avoid this behavior in certain corner
      cases (such as `lens`, whose use case is documented in #16876) to do
      so.
      
      Along the way, I did a little cleanup of the relevant code and
      documentation:
      
      * `enableCodeGenForUnboxedTuples` was only checking for the presence
        of `UnboxedTuples`, but `UnboxedSums` has the same complications.
        I fixed this and renamed the function to
        `enableCodeGenForUnboxedTuplesOrSums`.
      * I amended the users' guide with a discussion of these issues.
      4f81fab0
  4. 25 Sep, 2019 8 commits
    • Vladislav Zavialov's avatar
      Standalone kind signatures (#16794) · 0b5eede9
      Vladislav Zavialov authored
      Implements GHC Proposal #54: .../ghc-proposals/blob/master/proposals/0054-kind-signatures.rst
      
      With this patch, a type constructor can now be given an explicit
      standalone kind signature:
      
        {-# LANGUAGE StandaloneKindSignatures #-}
        type Functor :: (Type -> Type) -> Constraint
        class Functor f where
          fmap :: (a -> b) -> f a -> f b
      
      This is a replacement for CUSKs (complete user-specified
      kind signatures), which are now scheduled for deprecation.
      
      User-facing changes
      -------------------
      
      * A new extension flag has been added, -XStandaloneKindSignatures, which
        implies -XNoCUSKs.
      
      * There is a new syntactic construct, a standalone kind signature:
      
          type <name> :: <kind>
      
        Declarations of data types, classes, data families, type families, and
        type synonyms may be accompanied by a standalone kind signature.
      
      * A standalone kind signature enables polymorphic recursion in types,
        just like a function type signature enables polymorphic recursion in
        terms. This obviates the need for CUSKs.
      
      * TemplateHaskell AST has been extended with 'KiSigD' to represent
        standalone kind signatures.
      
      * GHCi :info command now prints the kind signature of type constructors:
      
          ghci> :info Functor
          type Functor :: (Type -> Type) -> Constraint
          ...
      
      Limitations
      -----------
      
      * 'forall'-bound type variables of a standalone kind signature do not
        scope over the declaration body, even if the -XScopedTypeVariables is
        enabled. See #16635 and #16734.
      
      * Wildcards are not allowed in standalone kind signatures, as partial
        signatures do not allow for polymorphic recursion.
      
      * Associated types may not be given an explicit standalone kind
        signature. Instead, they are assumed to have a CUSK if the parent class
        has a standalone kind signature and regardless of the -XCUSKs flag.
      
      * Standalone kind signatures do not support multiple names at the moment:
      
          type T1, T2 :: Type -> Type   -- rejected
          type T1 = Maybe
          type T2 = Either String
      
        See #16754.
      
      * Creative use of equality constraints in standalone kind signatures may
        lead to GHC panics:
      
          type C :: forall (a :: Type) -> a ~ Int => Constraint
          class C a where
            f :: C a => a -> Int
      
        See #16758.
      
      Implementation notes
      --------------------
      
      * The heart of this patch is the 'kcDeclHeader' function, which is used to
        kind-check a declaration header against its standalone kind signature.
        It does so in two rounds:
      
          1. check user-written binders
          2. instantiate invisible binders a la 'checkExpectedKind'
      
      * 'kcTyClGroup' now partitions declarations into declarations with a
        standalone kind signature or a CUSK (kinded_decls) and declarations
        without either (kindless_decls):
      
          * 'kinded_decls' are kind-checked with 'checkInitialKinds'
          * 'kindless_decls' are kind-checked with 'getInitialKinds'
      
      * DerivInfo has been extended with a new field:
      
          di_scoped_tvs :: ![(Name,TyVar)]
      
        These variables must be added to the context in case the deriving clause
        references tcTyConScopedTyVars. See #16731.
      0b5eede9
    • Ryan Scott's avatar
      Remove unneeded CPP now that GHC 8.6 is the minimum · 795986aa
      Ryan Scott authored
      The minimum required GHC version for bootstrapping is 8.6, so we can
      get rid of some unneeded `#if `__GLASGOW_HASKELL__` CPP guards, as
      well as one `MIN_VERSION_ghc_prim(0,5,3)` guard (since GHC 8.6 bundles
      `ghc-prim-0.5.3`).
      795986aa
    • Ben Gamari's avatar
      base: Move Ix typeclass to GHC.Ix · d90d0bad
      Ben Gamari authored
      The `Ix` class seems rather orthogonal to its original home in
      `GHC.Arr`.
      d90d0bad
    • Sebastian Graf's avatar
      PmCheck: Only ever check constantly many models against a single pattern · ebc65025
      Sebastian Graf authored
      Introduces a new flag `-fmax-pmcheck-deltas` to achieve that. Deprecates
      the old `-fmax-pmcheck-iter` mechanism in favor of this new flag.
      
      From the user's guide:
      
      Pattern match checking can be exponential in some cases. This limit makes sure
      we scale polynomially in the number of patterns, by forgetting refined
      information gained from a partially successful match. For example, when
      matching `x` against `Just 4`, we split each incoming matching model into two
      sub-models: One where `x` is not `Nothing` and one where `x` is `Just y` but
      `y` is not `4`. When the number of incoming models exceeds the limit, we
      continue checking the next clause with the original, unrefined model.
      
      This also retires the incredibly hard to understand "maximum number of
      refinements" mechanism, because the current mechanism is more general
      and should catch the same exponential cases like PrelRules at the same
      time.
      
      -------------------------
      Metric Decrease:
      ...
      ebc65025
    • John Ericson's avatar
      includes/CodeGen.Platform.hs don't include ghcautoconf.h · 4540bbe2
      John Ericson authored
      It doesn't need it, and it shouldn't need it or else multi-target will
      break.
      4540bbe2
    • Kari Pahula's avatar
      Add -Wderiving-defaults (#15839) · 2970dc7a
      Kari Pahula authored
      Enabling both DeriveAnyClass and GeneralizedNewtypeDeriving can cause
      a warning when no explicit deriving strategy is in use. This change adds
      an enable/suppress flag for it.
      2970dc7a
    • Matthew Pickering's avatar
      Add ghcide configuration files · 218c5dbf
      Matthew Pickering authored
      This commit adds three new files
      
      1. A hie.yaml file to the project root which specifies to IDEs how to
      set up the correct environment for loading GHC. This currently
      specifies to call the `./hadrian/hie-bios` script.
      2. A `hie.yaml` file for the hadrian subcomponent, which uses the
      `cabal` cradle type.
      2. The `./hadrian/hie-bios` script which supplies the correct arguments
      for an IDE to start a session.
      
      With these two files it is possible to run
      
      ```
      ghcide compiler/
      ```
      
      and successfully load all the modules for use in the IDE.
      
      or
      
      ```
      ghcide --cwd hadrian/ src/
      ```
      
      to test loading all of Hadrian's modules.
      
      Closes #17194
      218c5dbf
    • Andreas Klebinger's avatar
      Fix bounds check in ocResolve_PEi386 for relocation values. · ed520678
      Andreas Klebinger authored
      The old test was wrong at least for gcc and the value -2287728808L.
      
      It also relied on implementation defined behaviour (right shift
      on a negative value), which might or might not be ok.
      Either way it's now a simple comparison which will always work.
      ed520678
  5. 24 Sep, 2019 7 commits
  6. 23 Sep, 2019 1 commit