| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
When using -fdicts-strict we generate references to absentError while
compiling ghc-prim. However we always load ghc-prim before base so this
caused linker errors.
We simply solve this by moving absentError into ghc-prim. This does mean
it's now a panic instead of an exception which can no longer be caught.
But given that it should only be thrown if there is a compiler error
that seems acceptable, and in fact we already do this for
absentSumFieldError which has similar constraints.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `Applicative` instance is the most important one (for
array/vector/sequence indexing purposes), but it deserves
all the usual ones.
T12545 does silly 1% wibbles both ways, it seems, maybe depending
on architecture.
Metric Increase:
T12545
Metric Decrease:
T12545
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's simpler to assume that base is NoImplicitPrelude,
otherwise running doctest on `GHC.*` modules would be tricky.
OTOH, most `GHC.List` (where the most name clashes are) examples
could be changed to use `import qualified Data.List as L`.
(GHC.List examples won't show for Foldable methods...).
With these changes majority of doctest examples are GHCi-"faithful",
my WIP GHC-independent doctest runner reports nice summary:
Examples: 582; Tried: 546; Skipped: 34; Success: 515; Errors: 33; Property Failures 2
Most error cases are *Hangs forever*.
I have yet to figure out how to demonstrate that in GHCi.
Some of divergences are actually stack overflows, i.e. caught by
runtime.
Few errorful cases are examples of infinite output, e.g.
>>> cycle [42]
[42,42,42,42,42,42,42,42,42,42...
while correct, they confuse doctest.
Another erroneous cases are where expected output has line comment, like
>>> fmap show (Just 1) -- (a -> b) -> f a -> f b
Just "1" -- (Int -> String) -> Maybe Int -> Maybe String
I think I just have to teach doctest to strip comments from expected
output.
This is a first patch in a series.
There is plenty of stuff already.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
As noted in !3132, this has rather severe knock-on consequences in
user-code. We'll need to revisit this before merging something along
these lines.
This reverts commit 9749fe1223d182b1f8e7e4f7378df661c509f396.
|
|
|
|
|
|
|
| |
This patch allows boot libraries to use unboxed sums without implicitly
depending on `base` package because of `absentSumFieldError`.
See updated Note [aBSENT_SUM_FIELD_ERROR_ID] in GHC.Core.Make
|
| |
|
|
|
|
|
|
|
| |
This fixes #18013 by adding INLINE pragmas to both Control.Category.>>>
and GHC.Desugar.>>>. The functional change in this patch is tiny (just
two lines of pragmas!), but an accompanying Note explains in gory
detail what’s going on.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This allows us to remove several bits of CPP that are either always
true or no longer reachable. As an added bonus, we no longer need to
worry about importing `Control.Monad.Fail.fail` qualified to avoid
clashing with `Control.Monad.fail`, since the latter is now the same
as the former.
|
| |
|
|
|
|
|
|
| |
This change adds an optional example.
Tracking: #17929
|
| |
|
|
|
|
|
|
|
|
|
| |
failIO has useful information in its demand signature (specifically that
it bottoms) which is hidden if it is SOURCE imported, as noted
in #16588. Rejigger things such that we don't SOURCE import it.
Metric Increase:
T13701
|
|
|
|
|
|
|
| |
Replace the outer `MVar` in `QSemN` with an `IORef`. This should
probably be lighter, and it removes the need for `uninterruptibleMask`.
Previously Differential Revision https://phabricator.haskell.org/D4896
|
|
|
|
| |
Generic1 instances to Kleisli
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC Proposal: 0013-unlifted-newtypes.rst
Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/98
Issues: #15219, #1311, #13595, #15883
Implementation Details:
Note [Implementation of UnliftedNewtypes]
Note [Unifying data family kinds]
Note [Compulsory newtype unfolding]
This patch introduces the -XUnliftedNewtypes extension. When this
extension is enabled, GHC drops the restriction that the field in
a newtype must be of kind (TYPE 'LiftedRep). This allows types
like Int# and ByteArray# to be used in a newtype. Additionally,
coerce is made levity-polymorphic so that it can be used with
newtypes over unlifted types.
The bulk of the changes are in TcTyClsDecls.hs. With -XUnliftedNewtypes,
getInitialKind is more liberal, introducing a unification variable to
return the kind (TYPE r0) rather than just returning (TYPE 'LiftedRep).
When kind-checking a data constructor with kcConDecl, we attempt to
unify the kind of a newtype with the kind of its field's type. When
typechecking a data declaration with tcTyClDecl, we again perform a
unification. See the implementation note for more on this.
Co-authored-by: Richard Eisenberg <rae@richarde.dev>
|
|
|
|
|
|
|
| |
Previously the haddocks for Control.Monad and Data.Functor gave
the impression that `fmap` was the only Functor method.
Fixes #16681.
|
|
|
|
|
|
| |
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail
Coauthored-by: Ben Gamari <ben@well-typed.com>
|
|
|
|
|
| |
This moves all URL references to Trac tickets to their corresponding
GitLab counterparts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #14037.
Metric Decrease:
T9872b
T9872d
Reviewers: bgamari, simonpj, hvr
Reviewed By: simonpj
Subscribers: AndreasK, simonpj, osa1, dfeuer, rwbarton, carter
GHC Trac Issues: #14037
Differential Revision: https://phabricator.haskell.org/D5249
|
|
|
|
|
|
| |
Alexandre Balde (rockbmb) points out that the fusion technology
for foldr2, zip, zipWith, etc is undocumented. This patch adds
comments to explain.
|
|
|
|
| |
GHC Trac Issues: #15447
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: RyanGlScott, ekmett, hvr, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #15995
Differential Revision: https://phabricator.haskell.org/D5456
|
|
|
|
|
|
| |
* laws are capitalized definition lists, no emphasis on the labels
* adds missing hyperlinks
* fixes other misc. Haddock markup issues.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FIxes #15189.
Reviewers: hvr, bgamari, simonmar, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15189
Differential Revision: https://phabricator.haskell.org/D5019
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This drastically cuts down on the number of Haddock warnings when making
docs for `base`. Plus this means more actual links end up in the docs!
Also fixed other small mostly markup issues in the documentation along
the way.
This is a docs-only change.
Reviewers: hvr, bgamari, thomie
Reviewed By: thomie
Subscribers: thomie, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5055
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15349 reveals that lazy blackholing can cause trouble for
`fixST` much like it can for `fixIO`. Make `fixST` work just
like `fixIO`.
Reviewers: simonmar, hvr, bgamari
Reviewed By: simonmar
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15349
Differential Revision: https://phabricator.haskell.org/D4948
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically:
* MonadFix
* MonadZip
* Data
* Foldable
* Traversable
* Eq1
* Ord1
* Read1
* Show1
* Generic
* Generic1
Fixes #15098.
Reviewers: RyanGlScott, hvr
Reviewed By: RyanGlScott
Subscribers: sjakobi, rwbarton, thomie, ekmett, carter
GHC Trac Issues: #15098
Differential Revision: https://phabricator.haskell.org/D4870
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When `readMVar` was implemented using `takeMVar` and `putMVar`,
we needed to use `modifyMVarMasked` in `readChan` just in case
the `readMVar` was interrupted between taking and putting. Now
that `readMVar` uses an atomic primop, this is impossible, so we can
safely unmask `readMVar`.
Reviewers: hvr, bgamari, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4738
|
|
|
|
|
| |
This data type witnesses the lifting of a monoid into an applicative
pointwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce a new Id for unused pointer values in unboxed sums that is
not CAFFY. Because the Id is not CAFFY it doesn't make non-CAFFY
definitions CAFFY, fixing #15038.
To make sure anything referenced by the new id will be retained we get a
stable pointer to in on RTS startup.
Test Plan: Passes validate
Reviewers: simonmar, simonpj, hvr, bgamari, erikd
Reviewed By: simonmar
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15038
Differential Revision: https://phabricator.haskell.org/D4680
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: ./validate
Reviewers: hvr, goldfire, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #11767
Differential Revision: https://phabricator.haskell.org/D4452
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix missing code example in changelog for 8.4.1
* List 'setEnv' as opposite of 'getEnv'
It seems best to direct users to use 'System.Environment.setEnv'
rather than 'System.Posix.Env.putEnv'. This is due to 'setEnv' being
located in the same module as 'getEnv' and my virtue of working on
Windows platform, whereas 'putEnv' does not have that quality because
it's part of the 'unix' package.
* Reflect in docs the fact that 'readMVar' is not a composition of
'takeMVVar' and 'putMVar' any more
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Distinguishing between "refutable" and "irrefutable" patterns
(as described by the Haskell Report) in incomplete pattern errors
was more confusing than helpful. Remove references to irrefutable
patterns.
Reviewers: hvr, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #14569
Differential Revision: https://phabricator.haskell.org/D4261
|
|
|
|
|
|
|
| |
When merging D4259 I had to resort to manual merge due to some conflicts that
arc couldn't sort out. Unfortunately in the process I merged the wrong version
of the patch. Fix this. Thanks to @ntc2 for the great documentation and noticing
my mistake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
* Reformat Control.Monad.mfilter docs
The formatting was bad, with everything running together, and a
paranthesis was missing. Now the examples and relation between
`filter` and `mfilter` are typeset as code blocks instead of inline.
* Add example to Control.Monad.join docs
The example is using `join . atomically` to run IO actions computed by
STM transactions.
I couldn't figure out how to link to the STM docs in
`Control.Monad.STM`, because that module comes from the `stm` package,
not from `base`, even though `stm` is also part of the GHC source
tree. So, instead I linked to the STM docs in `GHC.Conc`, which seems
inferior to linking to `Control.Monad.STM`, but better than having no
links at all.
* Add example to Control.Monad.forever docs
The example is a simple TCP echo server. To make the uses of `forever`
stand out in the example code, I only link to the non-`forever`
functions (e.g. `forkFinally`) in the import lists.
Reviewers: bgamari, hvr
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4259
|
|
|
|
|
|
| |
The formatting was bad, with everything running together, and a
paranthesis was missing. Now the examples and relation between
`filter` and `mfilter` are typeset as code blocks instead of inline.
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, Phyx, austin, hvr, simonmar
Reviewed By: bgamari
Subscribers: syd, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4041
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes Issue #12372: documentation for Control.Monad.guard not
useful after AMP.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4258
|