This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 04 Jul, 2016 1 commit
  2. 18 Jun, 2016 1 commit
    • Ryan Scott's avatar
      Add Bifoldable and Bitraversable to base · 270d545d
      Ryan Scott authored
      This adds `Data.Bifoldable` and `Data.Bitraversable` from the
      `bifunctors` package to `base`, completing the migration started in
      D336.  This is fairly straightforward, although there were a suprising
      amount of reinternal organization in `base` that was needed for this to
      happen:
      
      * `Data.Foldable`, `Data.Traversable`, `Data.Bifoldable`, and
        `Data.Bitraversable` share some nonexported datatypes (e.g., `StateL`,
        `StateR`, `Min`, `Max`, etc.) to implement some instances. To avoid
        code duplication, I migrated this internal code to a new hidden
        module, `Data.Functor.Utils` (better naming suggestions welcome).
      
      * `Data.Traversable` and `Data.Bitraversable` also make use of an
        identity newtype, so I modified them to use
        `Data.Functor.Identity.Identity`. This has a ripple effect on several
        other modules, since I had to move instances around in order to avoid
        dependency cycles.
      
      Fixes #10448.
      
      Reviewers: ekmett, hvr, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2284
      
      GHC Trac Issues: #9682, #10448
      270d545d
  3. 12 May, 2016 1 commit
    • Ryan Scott's avatar
      Make Generic1 poly-kinded · b8e25651
      Ryan Scott authored
      This generalizes the `Generic1` typeclass to be of kind `k -> *`, and
      this also makes the relevant datatypes and typeclasses in `GHC.Generics`
      poly-kinded. If `PolyKinds` is enabled, `DeriveGeneric` derives
      `Generic1` instances such that they use the most general kind possible.
      Otherwise, deriving `Generic1` defaults to make an instance where the
      argument is of kind `* -> *` (the current behavior).
      
      Fixes #10604. Depends on D2117.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, goldfire, austin, hvr, simonpj, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie, ekmett
      
      Differential Revision: https://phabricator.haskell.org/D2168
      
      GHC Trac Issues: #10604
      b8e25651
  4. 02 May, 2016 1 commit
    • Facundo Domínguez's avatar
      StaticPointers: Allow closed vars in the static form. · 36d29f7c
      Facundo Domínguez authored
      Summary:
      With this patch closed variables are allowed regardless of whether
      they are bound at the top level or not.
      
      The FloatOut pass is always performed. When optimizations are
      disabled, only expressions that go to the top level are floated.
      Thus, the applications of the StaticPtr data constructor are always
      floated.
      
      The CoreTidy pass makes sure the floated applications appear in the
      symbol table of object files. It also collects the floated bindings
      and inserts them in the static pointer table.
      
      The renamer does not check anymore if free variables appearing in the
      static form are top-level. Instead, the typechecker looks at the
      tct_closed flag to decide if the free variables are closed.
      
      The linter checks that applications of StaticPtr only occur at the
      top of top-level bindings after the FloatOut pass.
      
      The field spInfoName of StaticPtrInfo has been removed. It used to
      contain the name of the top-level binding that contains the StaticPtr
      application. However, this information is no longer available when the
      StaticPtr is constructed, as the binding name is determined now by the
      FloatOut pass.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, simonpj, austin, hvr, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie, mpickering, mboes
      
      Differential Revision: https://phabricator.haskell.org/D2104
      
      GHC Trac Issues: #11656
      36d29f7c
  5. 01 May, 2016 1 commit
    • Ryan Scott's avatar
      Export constructors for IntPtr and WordPtr · a28611b1
      Ryan Scott authored
      This finishes what #5529 started by exporting the constructors for
      `IntPtr` and `WordPtr` from `Foreign.Ptr`, allowing them to be used in
      `foreign` declarations.
      
      Fixes #11983.
      
      Test Plan: `make TEST=T11983`
      
      Reviewers: simonpj, hvr, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2142
      
      GHC Trac Issues: #11983
      a28611b1
  6. 11 Apr, 2016 1 commit
    • duairc's avatar
      Added (more) missing instances for Identity and Const · 8b57cac5
      duairc authored
        * `Identity` and `Const` now have `Num`, `Real`, `Integral`,
          `Fractional`, `Floating`, `RealFrac` and `RealFloat` instances
      
        * `Identity` and `Const` now have `Bits` and `FiniteBits` instances
      
        * `Identity` and `Const` now have `IsString` instances
      
      Reviewers: RyanGlScott, austin, hvr, bgamari, ekmett
      
      Reviewed By: ekmett
      
      Subscribers: nomeata, ekmett, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2079
      
      GHC Trac Issues: #11790
      8b57cac5
  7. 29 Mar, 2016 1 commit
  8. 29 Feb, 2016 1 commit
    • Ryan Scott's avatar
      Missing Proxy instances, make U1 instance more Proxy-like · 171d95df
      Ryan Scott authored
      This accomplishes three things:
      
      * Adds missing `Alternative`, `MonadPlus`, and `MonadZip` instances for
        `Proxy`
      * Adds a missing `MonadPlus` instance for `U1`
      * Changes several existing `U1` instances to use lazy pattern-matching,
        exactly how `Proxy` does it (in case we ever replace `U1` with
        `Proxy`). This is technically a breaking change (albeit an extremely
        minor one).
      
      Test Plan: ./validate
      
      Reviewers: austin, ekmett, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1962
      
      GHC Trac Issues: #11650
      171d95df
  9. 25 Feb, 2016 1 commit
    • Ryan Scott's avatar
      Add more type class instances for GHC.Generics · 673efccb
      Ryan Scott authored
      GHC.Generics provides several representation data types that have
      obvious instances of various type classes in base, along with various
      other types of meta-data (such as associativity and fixity).
      Specifically, instances have been added for the following type classes
      (where possible):
      
          - Applicative
          - Data
          - Functor
          - Monad
          - MonadFix
          - MonadPlus
          - MonadZip
          - Foldable
          - Traversable
          - Enum
          - Bounded
          - Ix
          - Generic1
      
      Thanks to ocharles for starting this!
      
      Test Plan: Validate
      
      Reviewers: ekmett, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1937
      
      GHC Trac Issues: #9043
      673efccb
  10. 12 Feb, 2016 1 commit
    • Ryan Scott's avatar
      Add IsList instance for CallStack, restore Show instance for CallStack · be3d7f66
      Ryan Scott authored
      Summary:
      Ties up loose ends from D1894.
      
      GHC 7.10.2 and 7.10.3 featured a `Show` instance for `CallStack`, but since it
      was derived, it broke encapsulation. This adds a `Show` instance which displays
      the `CallStack` as if it were a `[(String, SrcLoc)]`.
      
      To ensure that the output of `Show` is technically a valid Haskell term, we
      also add a corresponding `IsList CallStack` instance.
      
      Reviewers: gridaphobe, austin, hvr, bgamari
      
      Reviewed By: gridaphobe, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1903
      be3d7f66
  11. 02 Feb, 2016 1 commit
    • Ryan Scott's avatar
      Make TypeError a newtype, add changelog entry · a7ad0b91
      Ryan Scott authored
      Summary:
      Phab:D866 added the `TypeError` datatype to `Control.Exception` to represent
      the error that is thrown when `-fdefer-type-errors` is on, but a changelog
      entry for it was never added. In addition, it should probably be a
      newtype.
      
      Reviewers: austin, hvr, KaneTW, bgamari
      
      Reviewed By: KaneTW, bgamari
      
      Subscribers: thomie, KaneTW
      
      Differential Revision: https://phabricator.haskell.org/D1873
      
      GHC Trac Issues: #10284
      a7ad0b91
  12. 23 Dec, 2015 1 commit
    • Eric Seidel's avatar
      Allow CallStacks to be frozen · 380b25ea
      Eric Seidel authored
      This introduces "freezing," an operation which prevents further
      locations from being appended to a CallStack.  Library authors may want
      to prevent CallStacks from exposing implementation details, as a matter
      of hygiene. For example, in
      
      ```
      head [] = error "head: empty list"
      
      ghci> head []
      *** Exception: head: empty list
      CallStack (from implicit params):
        error, called at ...
      ```
      
      including the call-site of `error` in `head` is not strictly necessary
      as the error message already specifies clearly where the error came
      from.
      
      So we add a function `freezeCallStack` that wraps an existing CallStack,
      preventing further call-sites from being pushed onto it. In other words,
      
      ```
      pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack
      ```
      
      Now we can define `head` to not produce a CallStack at all
      
      ```
      head [] =
        let ?callStack = freezeCallStack emptyCallStack
        in error "head: empty list"
      
      ghci> head []
      *** Exception: head: empty list
      CallStack (from implicit params):
        error, called at ...
      ```
      
      ---
      
      1. We add the `freezeCallStack` and `emptyCallStack` and update the
         definition of `CallStack` to support this functionality.
      
      2. We add `errorWithoutStackTrace`, a variant of `error` that does not
         produce a stack trace, using this feature. I think this is a sensible
         wrapper function to provide in case users want it.
      
      3. We replace uses of `error` in base with `errorWithoutStackTrace`. The
         rationale is that base does not export any functions that use CallStacks
         (except for `error` and `undefined`) so there's no way for the stack
         traces (from Implicit CallStacks) to include user-defined functions.
         They'll only contain the call to `error` itself. As base already has a
         good habit of providing useful error messages that name the triggering
         function, the stack trace really just adds noise to the error. (I don't
         have a strong opinion on whether we should include this third commit,
         but the change was very mechanical so I thought I'd include it anyway in
         case there's interest)
      
      4. Updates tests in `array` and `stm` submodules
      
      Test Plan: ./validate, new test is T11049
      
      Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D1628
      
      GHC Trac Issues: #11049
      380b25ea
  13. 21 Dec, 2015 6 commits
    • Ben Gamari's avatar
      base: Add sections to changelog · fb3302c9
      Ben Gamari authored
      fb3302c9
    • duairc's avatar
      Added missing instances for Identity and Const (#11210) · 2dff6c18
      duairc authored
      The following instances are added
      
          instance Bounded a => Bounded (Const a b)
          instance Enum a => Enum (Const a b)
          instance Ix a => Ix (Const a b)
          instance Storable a => Storable (Const a b)
      
          instance Bounded a => Bounded (Identity a)
          instance Enum a => Enum (Identity a)
          instance Ix a => Ix (Identity a)
          instance Semigroup a => Semigroup (Identity a)
          instance Storable a => Storable (Identity a)
      
      Reviewers: ekmett, RyanGlScott, rwbarton, hvr, austin, bgamari
      
      Reviewed By: RyanGlScott, hvr
      
      Subscribers: rwbarton, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1626
      
      GHC Trac Issues: #11210
      2dff6c18
    • Ryan Scott's avatar
      Encode strictness in GHC generics metadata · ee6fba89
      Ryan Scott authored
      This augments `MetaSel` with a `Bang` field, which gives generic
      programmers access to the following information about each field
      selector:
      
      * `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`,
        `{-# UNPACK #-}`, or not
      * `SourceStrictness`: whether a field was given a strictness (`!`) or
        laziness (`~`) annotation
      * `DecidedStrictness`: what strictness GHC infers for a field during
        compilation, which may be influenced by optimization levels,
        `-XStrictData`, `-funbox-strict-fields`, etc.
      
      Unlike in Phab:D1603, generics does not grant a programmer the ability
      to "splice" in metadata, so there is no issue including
      `DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to
      be split off).
      
      One consequence of this is that `MetaNoSel` had to be removed, since it
      became redundant. The `NoSelector` empty data type was also removed for
      similar reasons.
      
      Fixes #10716.
      
      Test Plan: ./validate
      
      Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1646
      
      GHC Trac Issues: #10716
      ee6fba89
    • dolio's avatar
      Implement phase 1 of expanded Floating · 6457903e
      dolio authored
      - This part of the proposal is to add log1p, expm1, log1pexp and
        log1mexp to the Floating class, and export the full Floating class
        from Numeric
      
      Reviewers: ekmett, #core_libraries_committee, bgamari, hvr, austin
      
      Reviewed By: ekmett, #core_libraries_committee, bgamari
      
      Subscribers: Phyx, RyanGlScott, ekmett, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1605
      
      GHC Trac Issues: #11166
      6457903e
    • duairc's avatar
      Move Const to own module in Data.Functor.Const and enable PolyKinds · edcf17bd
      duairc authored
      `Const` from `Control.Applicative` can trivially be made
      kind-polymorphic in its second argument. There has been a Trac issue
      about this for nearly a year now. It doesn't look like anybody objects
      to it, so I figured I might as well make a patch.
      
      Trac Issues: #10039, #10865, #11135
      
      Differential Revision: https://phabricator.haskell.org/D1630
      
      Reviewers: ekmett, hvr, bgamari
      
      Subscribers: RyanGlScott, thomie
      edcf17bd
    • dolio's avatar
      Modify IsString String instance (fixes #10814) · b225b234
      dolio authored
      The new instance resolves to `s ~ [Char]` as soon as we know that `s ~
      [a]`, to avoid certain functions (like (++)) causing a situation where
      `a` is ambiguous and (currently) unable to be defaulted.
      
      Reviewers: #core_libraries_committee, hvr, austin, bgamari
      
      Reviewed By: hvr, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1572
      
      GHC Trac Issues: #10814
      b225b234
  14. 17 Dec, 2015 1 commit
  15. 12 Dec, 2015 1 commit
    • Eric Seidel's avatar
      Rework the Implicit CallStack solver to handle local lets. · 3ec8288a
      Eric Seidel authored
      We can't just solve CallStack constraints indiscriminately when they
      occur in the RHS of a let-binder. The top-level given CallStack (if
      any) will not be in scope, so I've re-worked the CallStack solver as
      follows:
      
      1. CallStacks are treated like regular IPs unless one of the following
         two rules apply.
      
      2. In a function call, we push the call-site onto a NEW wanted
         CallStack, which GHC will solve as a regular IP (either directly from a
         given, or by quantifying over it in a local let).
      
      3. If, after the constraint solver is done, any wanted CallStacks
         remain, we default them to the empty CallStack. This rule exists mainly
         to clean up after rule 2 in a top-level binder with no given CallStack.
      
      In rule (2) we have to be careful to emit the new wanted with an
      IPOccOrigin instead of an OccurrenceOf origin, so rule (2) doesn't fire
      again. This is a bit shady but I've updated the Note to explain the
      trick.
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari, hvr
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1422
      
      GHC Trac Issues: #10845
      3ec8288a
  16. 07 Dec, 2015 1 commit
  17. 18 Nov, 2015 1 commit
  18. 16 Nov, 2015 1 commit
  19. 03 Nov, 2015 2 commits
  20. 02 Nov, 2015 1 commit
  21. 01 Nov, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Bump `base` version to 4.9.0.0 (closes #11026) · f8ba4b55
      Herbert Valerio Riedel authored
      This also relaxes a few upper bounds on base in the ghc.git repo;
      
      This required a mass-rewrite in testsuite/
      
        sed -i s,base-4.8.2.0,base-4.9.0.0,g $(git grep -Fl 'base-4.8.2.0')
      
      because it turns out the testsuite is still sensitive to package version
      changes.
      f8ba4b55
  22. 19 Oct, 2015 1 commit
    • Facundo Domínguez's avatar
      base: Have the argument of mask restore the state. · 2b25a589
      Facundo Domínguez authored
      The implementation of `mask` and `uninterruptibleMask` assumed so far
      that the restore argument would be called in a context with the same
      masking state as that set by `mask` or `uninterruptibleMask`.
      
      This patch has the restore argument restore the masking, whatever the
      current masking state is.
      
      Test Plan: validate
      
      Reviewers: simonmar, hvr, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, qnikst
      
      Differential Revision: https://phabricator.haskell.org/D1327
      
      GHC Trac Issues: #10149
      2b25a589
  23. 17 Oct, 2015 1 commit
  24. 16 Oct, 2015 1 commit
  25. 13 Oct, 2015 1 commit
  26. 10 Oct, 2015 1 commit
    • Ben Gamari's avatar
      Keep `shift{L,R}` on `Integer` from segfaulting · 182c44da
      Ben Gamari authored
      This can happen because the underlying primitive operations in
      `integer-gmp` don't support negative shift-amounts, and since
      `integer-gmp` can't throw proper exceptions and just provides a
      low-level API, it simply segfaults instead...
      
      This patch simply removes the `shift{L,R}` method definitions (and
      defines `unsafeShift{L,R}` instead) whose default-impls fallback on
      using `shift` which properly handles negative shift arguments.
      
      This addresses #10571
      
      Test Plan: harbormaster can do it
      
      Reviewers: hvr, austin, rwbarton
      
      Subscribers: rwbarton, thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1018
      
      GHC Trac Issues: #10571
      182c44da
  27. 03 Oct, 2015 1 commit
    • Ryan Scott's avatar
      Make GHC generics capable of handling unboxed types · 6cde981a
      Ryan Scott authored
      This adds a data family (`URec`) and six data family instances (`UAddr`,
      `UChar`, `UDouble`, `UFloat`, `UInt`, and `UWord`) which a `deriving
      Generic(1)` clause will generate if it sees `Addr#`, `Char#`, `Double#`,
      `Float#`, `Int#`, or `Word#`, respectively. The programmer can then
      provide instances for these data family instances to provide custom
      implementations for unboxed types, similar to how derived `Eq`, `Ord`,
      and `Show` instances currently special-case unboxed types.
      
      Fixes #10868.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, dreixel, bgamari, austin, hvr, kosmikus
      
      Reviewed By: dreixel, kosmikus
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1239
      
      GHC Trac Issues: #10868
      6cde981a
  28. 02 Oct, 2015 1 commit
  29. 29 Aug, 2015 1 commit
    • Ryan Scott's avatar
      Make Generic (Proxy t) instance poly-kinded (fixes #10775) · a6826c5d
      Ryan Scott authored
      This amounts to enabling PolyKinds in GHC.Generics. However, explicit
      kind signatures must be applied to the datatypes and typeclasses in
      GHC.Generics to ensure that the Core which TcGenGenerics generates
      is properly kinded.
      
      Several of the typeclasses in GHC.Generics could be poly-kinded, but
      this differential does not attempt to address this, since D493 already
      addresses this.
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin, dreixel, bgamari
      
      Reviewed By: austin, dreixel, bgamari
      
      Subscribers: goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1166
      
      GHC Trac Issues: #10775
      a6826c5d
  30. 07 Aug, 2015 1 commit
  31. 06 Aug, 2015 1 commit
    • Fumiaki Kinoshita's avatar
      base: Add instances · 97843d0b
      Fumiaki Kinoshita authored
      This patch adds following instances:
      
      * Foldable ZipList
      * Traversable ZipList
      * Functor Complex
      * Applicative Complex
      * Monad Complex
      * Foldable Complex
      * Traversable Complex
      * Generic1 Complex
      * Monoid a => Monoid (Identity a)
      * Storable ()
      
      Reviewers: ekmett, fumieval, hvr, austin
      
      Subscribers: thomie, #core_libraries_committee
      
      Projects: #core_libraries_committee
      
      Differential Revision: https://phabricator.haskell.org/D1049
      
      GHC Trac Issues: #10609
      97843d0b
  32. 05 Aug, 2015 1 commit
  33. 30 Jul, 2015 1 commit
  34. 07 Jul, 2015 1 commit
    • Ryan Scott's avatar
      Export more types from GHC.RTS.Flags (#9970) · 1967a52d
      Ryan Scott authored
      Export the data types `GiveGCStats`, `DoCostCentres`, `DoHeapProfiles`,
      and `DoTrace`, as well as the type synonyms `Time` and `RtsNat`. The
      above data types appear as fields in the `-Stats` data types in
      `GHC.RTS.Flags`, but since they only have `Show` instances, it is
      practically impossible to due anything useful with the above types
      unless they are exported.
      
      Reviewers: hvr, ekmett, austin, ezyang, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1030
      
      GHC Trac Issues: #9970
      1967a52d