summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* base: Update acosh to handle -1::ComplexAlex Bradley2017-09-051-1/+2
| | | | | | | | | | | | | | Summary: Fixes #8532 Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #8532 Differential Revision: https://phabricator.haskell.org/D3916
* Move NonEmpty definition into GHC.BaseHerbert Valerio Riedel2017-09-0412-87/+102
| | | | | | This is a preparatory refactoring for Semigroup=>Monoid as it prevents a messy .hs-boot file which would interact inconveniently with the buildsystem...
* Document the Generic(1) lawsRyan Scott2017-09-021-2/+16
| | | | | | | | | | | | | | | | Summary: Some code that @dfeuer was writing implicitly depended on these laws, but they didn't appear to be enshrined in the Haddocks. Let's do so. Test Plan: Read it Reviewers: austin, hvr, bgamari, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie, dfeuer Differential Revision: https://phabricator.haskell.org/D3908
* Document the intricacies of ForallC variable quantification betterRyan Scott2017-09-021-0/+29
| | | | | | | | | | | | | | | | | | Summary: I recently (re-)discovered that `ForallC` quantifies different type variables depending on whether `GadtC` is present or not. This is an important enough gotcha where I feel like this fact should also be advertised in the `template-haskell` documentation itself, so this patch does just that. Test Plan: Read it Reviewers: goldfire, austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13885 Differential Revision: https://phabricator.haskell.org/D3880
* Update transformers submoduleHerbert Valerio Riedel2017-09-021-0/+0
| | | | | | | This updates `transformers` from the v0.5.2 release to the v0.5.4 release + unreleased changes This is a pre-requisite for the Semigroup=>Monoid implementation
* Improve stm haddocksBen Gamari2017-09-011-27/+32
| | | | While looking at #14171 I noticed these readability issues. Fix them.
* PackageDb: Explicitly unlock package database before closingBen Gamari2017-08-291-1/+5
| | | | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13945 Differential Revision: https://phabricator.haskell.org/D3874
* base: Add support for file unlockingBen Gamari2017-08-291-0/+30
| | | | | | | | Reviewers: austin, hvr Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3875
* ghc-pkg: Try opening lockfiles in read-write mode firstBen Gamari2017-08-291-8/+14
| | | | | | | | | | | | | | | | | | | As pointed out in #13945, some filesystems only allow allow exclusive locks if the fd being locked was opened for write access. This causes ghc-pkg to fail as it first attempts to open and exclusively lock its lockfile in read-only mode to accomodate package databases for which we lack write permissions (e.g. global package databases). Instead, we now try read-write mode first, falling back to read-only mode if this fails. Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13945 Differential Revision: https://phabricator.haskell.org/D3897
* Add strict variant of iterateBen Gamari2017-08-257-2/+43
| | | | | | | | | | | | | | Summary: This closes the nearly-eight-year-old #3474. Test Plan: Validate Reviewers: RyanGlScott, austin, hvr Subscribers: rwbarton, thomie GHC Trac Issues: #3474 Differential Revision: https://phabricator.haskell.org/D3870
* CNF: Implement compaction for small pointer arraysBen Gamari2017-08-242-0/+9
| | | | | | | | | | | | | | Test Plan: Validate Reviewers: austin, erikd, simonmar, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, andrewthad, thomie, dfeuer GHC Trac Issues: #13860, #13857 Differential Revision: https://phabricator.haskell.org/D3888
* Fixed a typo in template-haskell documentationBenjamin Hodgson2017-08-221-1/+1
| | | | | | The documentation for `Type`'s `ForallT` constructor had a typo (pun not intended). `ctxt` is separated from `type` in the surface syntax by a fat arrow (`=>`), not a thin arrow (`->`).
* Make law for Foldable.length explicitAlain O'Dea2017-08-221-0/+2
| | | | | | | | | | | | Test Plan: Documentation only. Not necessary. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3878
* Make the Read instance for Proxy (and friends) ignore precedenceRyan Scott2017-08-228-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The `Read` instance for `Proxy`, as well as a handful of other data types in `base` which only have a single constructor, are doing something skeevy: they're requiring that they be surrounded by parentheses if the parsing precedence is sufficiently high. This means that `"Thing (Proxy)"` would parse, but not `"Thing Proxy"`. But the latter really ought to parse, since there's no need to surround a single constructor with parentheses. Indeed, that's the output of `show (Thing Proxy)`, so the current `Read` instance for `Proxy` violates `read . show = id`. The simple solution is to change `readParen (d > 10)` to `readParen False` in the `Read` instance for `Proxy`. But given that a derived `Read` instance would essentially accomplish the same thing, but with even fewer characters, I've opted to just replace the hand-rolled `Read` instance with a derived one. Test Plan: make test TEST=T12874 Reviewers: ekmett, austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12874 Differential Revision: https://phabricator.haskell.org/D3871
* Revert "Add strict variant of iterate"Ben Gamari2017-08-194-29/+1
| | | | | This was not ready to commit. This reverts commit 8e5b6ec6566da57d15b0810a07902d9eac85cb79.
* Add strict variant of iterateBen Gamari2017-08-184-1/+29
| | | | This closes the nearly-eight-year-old #3474.
* Doctests for Data.TupleDavid Luposchainsky2017-08-181-1/+20
|
* Make function intToSBigNat# preserve sign (fixes #14085)Olivier Chéron2017-08-172-2/+2
| | | | | | | | | | | | | | | | | | | Impacts only functions gcdExtInteger, powModInteger and recipModInteger which gave invalid results on negative S# inputs. Also fixes gcdExtInteger assertion when first argument is negative. Test Plan: Updated test case integerGmpInternals Reviewers: austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14085 Differential Revision: https://phabricator.haskell.org/D3826
* Loads of doc(test)sDavid Luposchainsky2017-08-1714-110/+272
|
* Convert documentation examples to doctests for ReadP moduleDavid Luposchainsky2017-08-171-73/+54
|
* Mention the category laws explicitlyDavid Luposchainsky2017-08-171-2/+7
|
* Add some Monoid doctestsDavid Luposchainsky2017-08-172-4/+38
|
* Insert missing blank line to fix Applicative docDavid Luposchainsky2017-08-171-0/+1
|
* Doctest for Void.absurdDavid Luposchainsky2017-08-171-0/+8
|
* Bump mtl, parsec, text submodules (again)Ryan Scott2017-08-163-0/+0
| | | | | | We failed to add dist-install and dist-boot to .gitignore in the commits brought in via commit e054c5f06451def4437d9d770ae156f034796c59. This round of submodule commits should do the trick.
* Bump mtl, parsec, text submodulesBen Gamari2017-08-153-0/+0
| | | | | a520adcce27908c799b64214618cf9b33572dc37 updated the upstream repository locations but failed to update the commits themselves.
* Add Semigroup/Monoid instances to ST monadBen Gamari2017-08-143-0/+12
| | | | | | | | | | | | | | | | Fixes #14107. Signed-off-by: Philipp Middendorf <middendorf@plapadoo.de> Reviewers: austin, hvr, bgamari, RyanGlScott Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie GHC Trac Issues: #14107 Differential Revision: https://phabricator.haskell.org/D3845
* Convert examples to doctests, and add a handful of new onesDavid Luposchainsky2017-08-061-35/+157
|
* Add forgotten > in Control.ApplicativeOleg Grenrus2017-08-061-1/+1
| | | As reported by tabaqui on `#hackage`
* Remove the deprecated Typeable{1..7} type synonymsRyan Scott2017-08-052-18/+2
| | | | | | | | | | | | | | | | | | | Summary: `Typeable{1..7}` (type synonyms for the poly-kinded `Typeable`) have been deprecated since GHC 7.8. They're now causing problems for users who try to still work with them in legacy code, since they can no longer be used in instances. To avoid this sort of confusion, let's just remove `Typeable{1..7}` altogether. Resolves #14047. Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14047 Differential Revision: https://phabricator.haskell.org/D3817
* Add MonadIO Q - by requiring MonadIO => QuasiOleg Grenrus2017-08-053-5/+15
| | | | | | | | | | | | Summary: This is follow-up to https://ghc.haskell.org/trac/ghc/ticket/10773 Reviewers: austin, goldfire, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3816
* Bump unix submoduleBen Gamari2017-08-011-0/+0
|
* Enable building Cabal with parsecHerbert Valerio Riedel2017-08-013-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cabal's parser has been rewritten in terms of Parsec (which is not enabled yet in Cabal-2.0 by default, but can be enabled by a cabal flag). The plan for Cabal is to drop support for the non-parsec parser, so we need to prepare GHC to cope with new situation. However, this means that lib:Cabal requires three new library dependency submodules, - parsec - text - mtl What complicates matters is that we need to build `ghc-cabal` early on during the bootstrap phase which currently needs to invoke `ghc --make` directly. So these additional dependencies need to be integrated into the monolithic `ghc --make` invocation which produces the `ghc-cabal` executable. Test Plan: `./validate --fast` passed Reviewers: austin, bgamari Subscribers: erikd, phadej, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3757
* Drop GHC 7.10 compatibilityRyan Scott2017-08-015-50/+10
| | | | | | | | | | | | | | | | GHC 8.2.1 is out, so now GHC's support window only extends back to GHC 8.0. This means we can delete gobs of code that was only used for GHC 7.10 support. Hooray! Test Plan: ./validate Reviewers: hvr, bgamari, austin, goldfire, simonmar Reviewed By: bgamari Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3781
* Allow Windows to set blank environment variablesHabib Alamin2017-07-316-5/+247
| | | | | | | | | | | | | | Test Plan: ./validate on harbormaster Reviewers: austin, hvr, bgamari, erikd, Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie GHC Trac Issues: #12494 Differential Revision: https://phabricator.haskell.org/D3726
* Follow-up to #13887, for promoted infix constructorsRyan Scott2017-07-291-2/+2
| | | | | | | | | | | | | | | | Summary: Correct a couple more spots in the TH pretty-printer by applying the appropriate parenthesization for infix names. Fixes #13887 (again). Test Plan: make test TEST=T13887 Reviewers: austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13887 Differential Revision: https://phabricator.haskell.org/D3802
* Add '<&>' operator to Data.Functor. '<&>' calls '<$>' with flipped arguments.Sven Tennie2017-07-295-0/+83
| | | | | | | | | | | | | | | | | | | | | This was proposed by David Feuer (https://mail.haskell.org/pipermail/libraries/2016-August/027293.html) and solves #14029. The implementation is a copy of the '<&>' operator in Control.Lens.Lens. Add tests for following Data.Functor operators: '<$>', '<&>', '<$' and '$>'. '<&>' was added for solving #14029. '<$>', '<$' and '$>' were probably untested. Reviewers: austin, hvr, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3800
* Ensure that GHC.Stack.callStack doesn't failBen Gamari2017-07-281-1/+4
| | | | | | | | | | | | | | | Test Plan: Validate, ensure the `f7` program of `IPLocation` doesn't crash. Reviewers: gridaphobe, austin, hvr Reviewed By: gridaphobe Subscribers: rwbarton, thomie GHC Trac Issues: #14028 Differential Revision: https://phabricator.haskell.org/D3795
* Merge types and kinds in DsMetaRyan Scott2017-07-284-788/+994
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Types and kinds are now the same in GHC... well, except in the code that involves Template Haskell, where types and kinds are given separate treatment. This aims to unify that treatment in the `DsMeta` module. The gist of this patch is replacing all uses of `repLKind` with `repLTy`. This is isn't quite as simple as one might imagine, since `repLTy` returns a `Core (Q Type)` (a monadic expression), whereas `repLKind` returns a `Core Kind` (a pure expression). This causes many awkward impedance mismatches. One option would be to change every combinator in `Language.Haskell.TH.Lib` to take `KindQ` as an argument instead of `Kind`. But this would be a breaking change of colossal proportions. Instead, this patch takes a somewhat different approach. This migrates the existing `Language.Haskell.TH.Lib` module to `Language.Haskell.TH.Lib.Internal`, and changes all `Kind`-related combinators in `Language.Haskell.TH.Lib.Internal` to live in `Q`. The new `Language.Haskell.TH.Lib` module then re-exports most of `Language.Haskell.TH.Lib.Internal` with the exception of the `Kind`-related combinators, for which it redefines them to be their current definitions (which don't live in `Q`). This allows us to retain backwards compatibility with previous `template-haskell` releases, but more importantly, it allows GHC to make as many changes to the `Internal` code as it wants for its purposes without fear of disrupting the public API. This solves half of #11785 (the other half being `TcSplice`). Test Plan: ./validate Reviewers: goldfire, austin, bgamari Reviewed By: goldfire Subscribers: rwbarton, thomie GHC Trac Issues: #11785 Differential Revision: https://phabricator.haskell.org/D3751
* Initialize hs_init with UTF8 encoded arguments on Windows.Andreas Klebinger2017-07-273-122/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: Get utf8 encoded arguments before we call hs_init and use them instead of ignoring hs_init arguments. This reduces differing behaviour of the RTS between windows and linux and simplifies the code involved. A few testcases were changed to expect the same result on windows as on linux after the changes. This fixes #13940. Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar, Phyx Subscribers: Phyx, rwbarton, thomie GHC Trac Issues: #13940 Differential Revision: https://phabricator.haskell.org/D3739
* base: Introduce GHC.ByteOrderBen Gamari2017-07-242-0/+32
| | | | | | | | | | | | | | | | This provides a ByteOrder type as well as a targetByteOrder value, which indicates the byte ordering used by the target machine. We might also consider exposing this via Data.Bits if the CLC is so inclined. Test Plan: Needs test Reviewers: hvr, RyanGlScott, austin Reviewed By: hvr, RyanGlScott Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3786
* ghc-prim: Don't allocate a thunk for each unpacked UTF-8 characterBen Gamari2017-07-241-12/+16
| | | | | | | | | | | | | | | | While debugging #14005 I noticed that unpackCStringUtf8# was allocating a thunk for each Unicode character that it unpacked. This seems hardly worthwhile given that the thunk's closure will be at least three words, whereas the Char itself will be only two and requires only a bit of bit twiddling to construct. Test Plan: Validate Reviewers: simonmar, austin Subscribers: dfeuer, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3769
* Add a caveat to the GHC.Generics examples about :+: nestingRyan Scott2017-07-241-22/+30
| | | | | | | | | | | | | | | | | | | Summary: GHC's choice in how it nests `:+:` can sometimes affect the implementaiton of `GHC.Generics`-related code, so we should make a note of this in the examples we provide. Fixes #9453. Test Plan: Read it, like it, build it, ship it Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #9453 Differential Revision: https://phabricator.haskell.org/D3782
* ghc-prim: Bump versionBen Gamari2017-07-232-2/+2
| | | | (cherry picked from commit 8c5405f63c2de0c445ec171aab63c35786544b9e)
* Bump integer-gmp versionBen Gamari2017-07-232-2/+8
| | | | (cherry picked from commit 09396ec3bb672e761c3e627484dd02c5a3a76c77)
* Bump a bunch of submodulesBen Gamari2017-07-239-0/+0
|
* Update autoconf scriptsBen Gamari2017-07-232-10/+24
| | | | Scripts taken from autoconf 81497f5aaf50a12a9fe0cba30ef18bda46b62959
* base: Improve docs to clarify when finalizers may not be runAndrew Martin2017-07-191-0/+26
|
* Add Haddocks for Eq (STRef a) and Eq (IORef a)Adam Sandberg Eriksson2017-07-192-7/+7
| | | | | | | | | | Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3750
* Typeable: Always use UTF-8 string unpacking primitiveBen Gamari2017-07-181-6/+6
| | | | | | | | Reviewers: austin, hvr Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3734