summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
...
* Make GHC generics capable of handling unboxed typesRyanGlScott2015-10-032-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix signature of atomic builtinsAndreas Schwab2015-10-021-112/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is due to Andreas Schwab. This fixes #10926, which reports (on AArch64) errors of the form, ``` /tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of 'hs_atomic_xor64' makes pointer from integer without a cast [-Wint-conversion] _c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]); ^ In file included from /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0, from /tmp/ghc1492_0/ghc_1.hc:3: /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/stg/Prim.h:41:11: note: expected 'volatile StgWord64 * {aka volatile long unsigned int *}' but argument is of type 'long unsigned int' StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val); ^ ``` Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1300 GHC Trac Issues: #10926
* Move CallStack back to baseBen Gamari2015-10-027-52/+86
| | | | | | | | | | | | | | | CallStack requires tuples, instances of which are defined in GHC.Tuple. Unfortunately the change made in D757 to the `Typeable` deriving mechanism means that `GHC.Tuple` must import `GHC.Types` for types necessary to generate type representations. This results in a cycle. Test Plan: Validate Reviewers: gridaphobe, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1298
* Document peculiarities of `traceM`.Matthias Fischmann2015-10-021-2/+8
| | | | | | | | | | Reviewers: bgamari, hvr, austin Reviewed By: bgamari, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1289
* Add Data.Semigroup and Data.List.NonEmpty (re #10365)Herbert Valerio Riedel2015-10-024-0/+1168
| | | | | | | | | | | | | This implements phase 1 of the semigroup-as-monoid-superclass proposal (https://ghc.haskell.org/wiki/Proposal/SemigroupMonoid). The modules were migrated from the `semigroups-0.17` release mostly as-is, except for dropping several trivial `{-# INLINE #-}`s, removing CPP usage, and instances for types & classes provided outside of `base` (e.g. `containers`, `deepseq`, `hashable`, `tagged`, `bytestring`, `text`) Differential Revision: https://phabricator.haskell.org/D1284
* Allow enumDeltaIntegerFB to be inlinedJoachim Breitner2015-09-281-1/+2
| | | | | | | The function is very small and the compiler should be at liberty to inline it. But it is recursive, so it did not do it before. By applying the usual transformation with a local recursive function, GHC can now inline it, producing the loop that one would expect.
* Weak: Don't require wrapping/unwrapping of finalizersBen Gamari2015-09-256-29/+10
| | | | | | | | | | To quote Simon Marlow, We don't expect users to ever write code that uses mkWeak# or finalizeWeak#, we have safe interfaces to these. Let's document the type unsafety and fix the problem with () without introducing any overhead. Updates stm submodule.
* Fix a bug with mallocForeignPtr and finalizers (#10904)Simon Marlow2015-09-241-15/+21
| | | | | | | | | | | | Summary: See Note [MallocPtr finalizers] Test Plan: validate; new test T10904 Reviewers: ezyang, bgamari, austin, hvr, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1275
* base: export allocation counter/limit API from System.MemSimon Marlow2015-09-233-8/+21
| | | | | | | | | | | Previously it was only available from GHC.Conc, but it makes sense for it to be available from a more official place where people might find it. While I was here, I improved the docs a little. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1272
* Update Cabal to recognize DeriveLiftRyanGlScott2015-09-231-0/+0
| | | | | | | | | | | | This should (1) fix the ./validate build, which I accidentally broke in D1168, and (2) update the Cabal submodule so that it recognizes `DeriveLift` as a GHC extension. Reviewed By: adamse, austin Differential Revision: https://phabricator.haskell.org/D1269 GHC Trac Issues: #1830
* Remove references to () from types of mkWeak# and friendsBen Gamari2015-09-237-15/+38
| | | | | | | Previously the types needlessly used (), which is defined ghc-prim, leading to unfortunate import cycles. See #10867 for details. Updates stm submodule.
* DeriveLift extension (#1830)RyanGlScott2015-09-211-0/+23
| | | | | | | | | | | | | | | | | | | | Summary: This implements -XDeriveLift, which allows for automatic derivation of the Lift class from template-haskell. The implementation is based off of Ian Lynagh's th-lift library (http://hackage.haskell.org/package/th-lift). Test Plan: ./validate Reviewers: hvr, simonpj, bgamari, goldfire, austin Reviewed By: goldfire, austin Subscribers: osa1, thomie Differential Revision: https://phabricator.haskell.org/D1168 GHC Trac Issues: #1830
* base: use Show for ErrorCall in uncaughtExceptionHandlerEric Seidel2015-09-216-3/+14
| | | | | | | | | | | | | The default top-level exception handler now uses the `Show` instance for `ErrorCall` when printing exceptions, so it will actually print the out-of-band data (e.g. `CallStack`s) in compiled binaries, instead of just printing the error message. This also updates the hpc submodule to fix the test output. Reviewed By: austin, thomie Differential Revision: https://phabricator.haskell.org/D1217
* Docs: make sure all libs are included in index.html (#10879)Thomas Miedema2015-09-181-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh gen_contents_index --intree' is run, which calls haddock to generate the haddock index at 'libraries/dist-haddock/index.html'. What it did before was check the ./packages file for all libraries. The problem is that 'base' and 'ghc-prim' were folded into the main repo some time ago, hence don't have an entry in the ./packages file anymore. As a result, 'base' and 'ghc-prim' were missing from the index.html file. It now simply runs haddock on all the all the `.haddock` files in the libraries directory. The only risk is that this could include the extra libraries in the index.html, if you ever built them in the past (with BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing this would be a little bit fiddly. Test Plan: 'make libraries/dist-haddock/index.html && grep -q base libraries/dist-haddock/index.html && echo ok' Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1247
* Add namePackage function to template-haskellRyanGlScott2015-09-173-2/+37
| | | | | | | | | | | | | | Currently there exists a nameBase function (for retrieving a Name's OccName) and a nameModule function (for retrieving a Name's ModName), but there is no counterpart for PkgNames. This would be useful for implementing Template Haskell features which need to have easy access to a Name's package (e.g., automatically derived Lift instances). Reviewed By: goldfire, austin, thomie Differential Revision: https://phabricator.haskell.org/D1237
* hpc: use `takeDirectory` instead of `dropWhileEnd (/= '/')`Thomas Miedema2015-09-121-0/+0
| | | | This fixes some hpc tests on Windows. Update submodule hpc.
* Testsuite: mark enum01-enum03 expect_broken(#9399) on WindowsThomas Miedema2015-09-121-4/+7
|
* Move GeneralCategory et al to GHC.UnicodeBen Gamari2015-09-084-211/+219
| | | | | | | | | | This allows these to be used from Text.Read.Lex import cycles. Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D1121 GHC Trac Issues: #10444
* Further simplify the story around minimum/maximumwip/D1229Joachim Breitner2015-09-071-25/+9
| | | | | | | | | | | | | | | | | | After I have found out that I should look at -ddump-prep and not -ddump-core, I noticed that these days, GHC is perfectly capeable of turning (the equivalent) of foldl to (the equivalent) of foldl' if the operation in question is strict. So instead of using rewrite rules to rewrite maximum to a strictMaximum for certain types, we simply use SPECIALIZE. This also marks maximum/minimum as INLINEABLE, so that client code can get similar specializations, hopefully even automatically. And inded, minimum applied to [Double] produces good code (although due to inlineing, not due to specialization, it seems). I checked (by looking at the core) that this still fixes #10788. Differential revision: https://phabricator.haskell.org/D1229
* SPECIALIZE strictMinimum for Int and IntegerJoachim Breitner2015-09-071-0/+4
| | | | | | | | This fixes a regression reported in #10788, where due to less inlining compared to earlier versions, we’d get worse code. With the SPECIALIZE, we get the good code, and moreover, the good code is in List.hs and _not_ inlined to the use site, so smaller code size and less compilation time.
* Make Data.List.foldr1 inlineJoachim Breitner2015-09-031-3/+5
| | | | | | | | | | Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830. Differential Revision: https://phabricator.haskell.org/D1205
* Injective type familiesJan Stolarek2015-09-035-53/+142
| | | | | | | | | | | | | | | | | | | For details see #6018, Phab:D202 and the wiki page: https://ghc.haskell.org/trac/ghc/wiki/InjectiveTypeFamilies This patch also wires-in Maybe data type and updates haddock submodule. Test Plan: ./validate Reviewers: simonpj, goldfire, austin, bgamari Subscribers: mpickering, bgamari, alanz, thomie, goldfire, simonmar, carter Differential Revision: https://phabricator.haskell.org/D202 GHC Trac Issues: #6018
* Fix some tests that were broken by D861Eric Seidel2015-09-021-0/+0
| | | | | | | | | | I didn't realize that `./validate` does not run every test :( Test Plan: ./validate --slow Update submodule hpc. Differential Revision: https://phabricator.haskell.org/D1204
* Testsuite: mark 4 tests expect_broken_for(#10712, opt_ways)Thomas Miedema2015-09-021-1/+1
| | | | Please revert when #10712 is fixed.
* stm: Fix test caseBen Gamari2015-09-021-0/+0
| | | | Updates stm submodule.
* Use IP based CallStack in error and undefinedEric Seidel2015-09-0213-120/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies `error`, `undefined`, and `assertError` to use implicit call-stacks to provide better error messages to users. There are a few knock-on effects: - `GHC.Classes.IP` is now wired-in so it can be used in the wired-in types for `error` and `undefined`. - `TysPrim.tyVarList` has been replaced with a new function `TysPrim.mkTemplateTyVars`. `tyVarList` made it easy to introduce subtle bugs when you need tyvars of different kinds. The naive ``` tv1 = head $ tyVarList kind1 tv2 = head $ tyVarList kind2 ``` would result in `tv1` and `tv2` sharing a `Unique`, thus substitutions would be applied incorrectly, treating `tv1` and `tv2` as the same tyvar. `mkTemplateTyVars` avoids this pitfall by taking a list of kinds and producing a single tyvar of each kind. - The types `GHC.SrcLoc.SrcLoc` and `GHC.Stack.CallStack` now live in ghc-prim. - The type `GHC.Exception.ErrorCall` has a new constructor `ErrorCallWithLocation` that takes two `String`s instead of one, the 2nd one being arbitrary metadata about the error (but usually the call-stack). A bi-directional pattern synonym `ErrorCall` continues to provide the old API. Updates Cabal, array, and haddock submodules. Reviewers: nh2, goldfire, simonpj, hvr, rwbarton, austin, bgamari Reviewed By: simonpj Subscribers: rwbarton, rodlogic, goldfire, maoe, simonmar, carter, liyang, bgamari, thomie Differential Revision: https://phabricator.haskell.org/D861 GHC Trac Issues: #5273
* integer-gmp: optimise bitBigNatHerbert Valerio Riedel2015-08-291-1/+18
| | | | | | | | | | | | | This is a somewhat minor optimisation exploiting the static knowledge of the operands involved allowing to save a few allocations. Reviewers: austin, rwbarton, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1179
* Make Generic (Proxy t) instance poly-kinded (fixes #10775)RyanGlScott2015-08-292-19/+22
| | | | | | | | | | | | | | | | | | | | | | | 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
* base: Remove a redundant 'return'Simon Peyton Jones2015-08-271-2/+1
|
* Implement getSizeofMutableByteArrayOp primopBen Gamari2015-08-211-28/+35
| | | | | | | | | | | | | | | Now since ByteArrays are mutable we need to be more explicit about when the size is queried. Test Plan: Add testcase and validate Reviewers: goldfire, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1139 GHC Trac Issues: #9447
* Build system: delete half-baked Cygwin supportThomas Miedema2015-08-201-5/+0
| | | | | | | | | | | | | | | | | | | We only support building GHC on mys2 nowadays, see https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows. This (partially) reverts various commits from a few years ago, among which: * 5775d5142da227d65fb86994d363eb16841ee642 "Add OSTYPE build-system variable, and use it" * 3fb8c431824aa2f3bd979e35d1a283546fcfbe74 "Fix building libgmp on cygwin" * cdbb4720c424500adb57cbbef69721d0b039fa46 "Fix cmd invocation by libffi cuild system on Windows 7 cygwin" * e8121501ee3549a35e954726ccfd871ac9d51f83 "Fix dblatex and xml* tool detection on Windows" Reviewed by: austin, Phyx Differential Revision: https://phabricator.haskell.org/D1155
* Testsuite: mark encoding005 expect_broken(#10623) on WindowsThomas Miedema2015-08-151-1/+2
|
* Testsuite: mark T8089 expect_broken(#7325) on WindowsThomas Miedema2015-08-151-1/+5
|
* template-haskell: Add changelog entry to infix type operatorsBen Gamari2015-08-121-0/+6
|
* Bump template-haskell to new major version 2.11Herbert Valerio Riedel2015-08-122-1/+8
| | | | | | | ...since we already have introduced backward compat breakage that breaks packages such as QuickCheck-2.8.1 Differential Revision: https://phabricator.haskell.org/D1144
* Update transformers submodule to 0.4.3.0 releaseHerbert Valerio Riedel2015-08-091-0/+0
| | | | Differential Revision: https://phabricator.haskell.org/D1140
* Make oneShot open-kindedJoachim Breitner2015-08-081-0/+7
| | | | | | | | | akio wants to use oneShot with unlifted types as well, and there is no good reason not to let him. This changes the type of the built-in oneShot definition to open kinds, and also expand the documentation a little bit. Differential Revision: https://phabricator.haskell.org/D1136
* Sync base/changelog.md with GHC 7.10.2 releaseHerbert Valerio Riedel2015-08-071-3/+4
| | | | [skip ci]
* base: Add missing Traversable instance for ZipListBen Gamari2015-08-072-3/+9
|
* base: Add instancesfumieval2015-08-065-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add Fixity info for infix typesRyanGlScott2015-08-053-11/+17
| | | | | | | | | | | | | | | | | | | | | | Template Haskell allows reification of fixity for infix functions and data constructors, and not for infix types. This adds a `Fixity` field to the relevant `Info` constructors that can have infix types (`ClassI`, `TyConI`, and `FamilyI`). I don't think that `VarI` or `PrimTyConI` can be infix, but I could be wrong. Test Plan: ./validate Reviewers: austin, goldfire, bgamari Reviewed By: goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1109 GHC Trac Issues: #10704
* Make sure that `all`, `any`, `and`, and `or` fuse (#9848)Takano Akio2015-08-054-0/+25
| | | | | | | | | | | | | | Test Plan: validate Reviewers: hvr, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1126 GHC Trac Issues: #9848
* Make Exception datatypes into newtypesRyanGlScott2015-08-053-6/+9
| | | | | | | | | | | | | | | Certain instances of `Exception` are simply datatypes with only one argument, which should be `newtype`s. Reviewers: ekmett, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1131 GHC Trac Issues: #10738
* Drop custom mapM impl for []Ben Gamari2015-08-051-3/+0
| | | | | | | | | | | | | | | | | See https://mail.haskell.org/pipermail/libraries/2015-May/025708.html for motivation. This fixes #10457 Test Plan: Validate Reviewers: hvr, austin Subscribers: simonmar, thomie, dolio Differential Revision: https://phabricator.haskell.org/D1124 GHC Trac Issues: #10457
* Typos in comments [skip ci]Gabor Greif2015-08-033-3/+3
|
* Update parallel submodule, and re-enable warningsSimon Marlow2015-08-031-0/+0
| | | | | | | | | | | | Test Plan: using remote validate Reviewers: austin, hvr, simonpj, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1117
* Testsuite: mark tests recently fixed as passing + accept new stderrThomas Miedema2015-07-301-0/+0
| | | | Update submodule array.
* Don't allowInterrupt inside uninterruptibleMaskBen Gamari2015-07-303-4/+24
| | | | | | | | This fixes #9516. Differential Revision: https://phabricator.haskell.org/D181 Authored-by: Edsko de Vries <edsko@well-typed.com>
* Comments onlySimon Peyton Jones2015-07-301-1/+1
|
* Fallout from more assiduous RULE warningsSimon Peyton Jones2015-07-284-15/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC now warns if rules compete, so that it's not predicatable which will work and which will not. E.g. {-# RULES f (g x) = ... g True = ... #-} If we had (f (g True)) it's not clear which rule would fire. This showed up fraility in the libraries. * Suppress warnigns in Control.Arrow, Control.Category for class methods. At the moment we simply don't have a good way to write a RULE with a class method in the LHS. See Trac #1595. Arrow and Category attempt to do so; I have silenced the complaints with -fno-warn-inline-rule-shadowing, but it's not a great solution. * Adjust the NOINLINE pragma on 'GHC.Base.map' to account for the map/coerce rule * Adjust the rewrite rules in Enum, especially for the "literal 1" case. See Note [Enum Integer rules for literal 1]. * Suppress warnings for 'bytestring' e.g. libraries/bytestring/Data/ByteString.hs:895:1: warning: Rule "ByteString specialise break (x==)" may never fire because rule "Class op ==" for ‘==’ might fire first Probable fix: add phase [n] or [~n] to the competing rule