summaryrefslogtreecommitdiff
path: root/libraries/base/Control
Commit message (Collapse)AuthorAgeFilesLines
* Fix doc typos in libraries/basetocic2023-04-233-4/+4
|
* Fixes to accomodate Data.List.{head,tail} with {-# WARNING #-}Bodigrim2023-03-301-2/+5
|
* JS: replace "js" architecture with "javascript"Sylvain Henry2023-02-061-1/+1
| | | | | | | | | | | | | | | Despite Cabal supporting any architecture name, `cabal --check` only supports a few built-in ones. Sadly `cabal --check` is used by Hackage hence using any non built-in name in a package (e.g. `arch(js)`) is rejected and the package is prevented from being uploaded on Hackage. Luckily built-in support for the `javascript` architecture was added for GHCJS a while ago. In order to allow newer `base` to be uploaded on Hackage we make the switch from `js` to `javascript` architecture. Fixes #22740. Co-authored-by: Ben Gamari <ben@smart-cactus.org>
* Refactor mkRuntimeErrorSimon Peyton Jones2022-12-221-6/+11
| | | | | | | | | This patch fixes #22634. Because we don't have TYPE/CONSTRAINT polymorphism, we need two error functions rather than one. I took the opportunity to rname runtimeError to impossibleError, to line up with mkImpossibleExpr, and avoid confusion with the genuine runtime-error-constructing functions.
* Add Javascript backendSylvain Henry2022-11-291-2/+33
| | | | | | | | | | | | | | | Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* Rename Solo[constructor] to MkSoloTorsten Schmits2022-09-212-2/+2
| | | | | | | | | | | Part of proposal 475 (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst) Moves all tuples to GHC.Tuple.Prim Updates ghc-prim version (and bumps bounds in dependents) updates haddock submodule updates deepseq submodule updates text submodule
* Add native delimited continuations to the RTSAlexis King2022-09-111-1/+22
| | | | | | | | | | | | | | | | | | | | | This patch implements GHC proposal 313, "Delimited continuation primops", by adding native support for delimited continuations to the GHC RTS. All things considered, the patch is relatively small. It almost exclusively consists of changes to the RTS; the compiler itself is essentially unaffected. The primops come with fairly extensive Haddock documentation, and an overview of the implementation strategy is given in the Notes in rts/Continuation.c. This first stab at the implementation prioritizes simplicity over performance. Most notably, every continuation is always stored as a single, contiguous chunk of stack. If one of these chunks is particularly large, it can result in poor performance, as the current implementation does not attempt to cleverly squeeze a subset of the stack frames into the existing stack: it must fit all at once. If this proves to be a performance issue in practice, a cleverer strategy would be a worthwhile target for future improvements.
* Replace dead link in Haddock documentation of Control.Monad.Fail (fixes #21602)BinderDavid2022-05-261-1/+1
|
* Explain that 'fail s' should run in the monad itselfTom Ellis2022-05-051-0/+4
|
* remove MonadFail instances of STArtem Pelenitsyn2022-03-051-4/+0
| | | | | | | | CLC proposal: https://github.com/haskell/core-libraries-committee/issues/33 The instances had `fail` implemented in terms of `error`, whereas the idea of the `MonadFail` class is that the `fail` method should be implemented in terms of the monad itself.
* Make modules in base stable.Hécate Moonlight2022-02-2817-17/+17
| | | | fix #18963
* Fix a few Note inconsistenciesBen Gamari2022-02-014-6/+4
|
* Define returnA = idOleg Grenrus2021-09-061-1/+1
|
* Added a hopefully clarificatory sentence about the notion of "atomicity" ↵Adrien2021-07-131-5/+13
| | | | presupposed in the documentation on MVar.
* Small ZipList optimisationViktor Dukhovni2021-06-071-2/+6
| | | | | | | | In (<|>) for ZipList, avoid processing the first argument twice (both as first argument of (++) and for its length in drop count of the second argument). Previously, the entire first argument was forced into memory, now (<|>) can run in constant space even with long inputs.
* Additionally export asum from Control.ApplicativeOleg Grenrus2021-03-301-1/+2
| | | | Fixes #19575
* Move absentError into ghc-prim.Andreas Klebinger2021-02-261-3/+3
| | | | | | | | | | | | 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.
* Apply 1 suggestion(s) to 1 file(s)Marcin Szamotulski2021-02-131-7/+15
|
* Improve bracket documentationMarcin Szamotulski2021-02-131-0/+8
|
* Add instances for GHC.Tuple.SoloBen Gamari2021-01-272-0/+12
| | | | | | | | | | | | | | | 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
* Change replicateM doctest exampleOleg Grenrus2021-01-221-4/+13
|
* Remove references to ApplicativeDo in the base haddocksHécate2021-01-131-26/+11
|
* Correct doctestsOleg Grenrus2021-01-022-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove redundant "do", "return" and language extensions from baseHécate2020-09-234-4/+4
|
* Remove all the unnecessary LANGUAGE pragmasHécate2020-08-052-11/+10
|
* winio: Multiple refactorings and support changes.Tamar Christina2020-07-151-0/+30
|
* Revert "Specify kind variables for inferred kinds in base."Ben Gamari2020-05-252-4/+4
| | | | | | | | 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.
* Fix unboxed-sums GC ptr-slot rubbish value (#17791)Sylvain Henry2020-05-091-5/+1
| | | | | | | 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
* Specify kind variables for inferred kinds in base.Baldur Blöndal2020-05-082-4/+4
|
* Add an INLINE pragma to Control.Category.>>>Alexis King2020-04-121-0/+64
| | | | | | | 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.
* Add an example to liftIO and explain its purposeHécate2020-04-091-0/+34
|
* Fix haddock formatting in Control.Monad.ST.Lazy.Imp.hsMaxim Koltsov2020-04-031-3/+3
|
* Require GHC 8.8 as the minimum compiler for bootstrappingRyan Scott2020-03-311-6/+5
| | | | | | | | 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.
* Base: add markup around ExceptTristan Cacqueray2020-03-251-1/+1
|
* Base: add Control.Applicative optional exampleTristan Cacqueray2020-03-251-0/+17
| | | | | | This change adds an optional example. Tracking: #17929
* Fix typo in documentation of Base.hs.Matthias Braun2019-12-051-1/+1
|
* base: Ensure that failIO isn't SOURCE importedBen Gamari2019-11-011-2/+1
| | | | | | | | | 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
* Use an IORef for QSemNDavid Feuer2019-10-231-39/+51
| | | | | | | 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
* base: add Functor, Applicative, Monad, Alternative, MonadPlus, Generic and ↵Fumiaki Kinoshita2019-07-281-0/+43
| | | | Generic1 instances to Kleisli
* Added do-notation examples for Functor, Applicative and Monad combinators.Baldur Blöndal2019-07-201-0/+32
|
* Data.Ord: give a field name getDown to DownFumiaki Kinoshita2019-06-181-1/+0
|
* Implement the -XUnliftedNewtypes extension.Andrew Martin2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* base: Include (<$) in all exports of FunctorSimon Jakobi2019-05-271-1/+1
| | | | | | | Previously the haddocks for Control.Monad and Data.Functor gave the impression that `fmap` was the only Functor method. Fixes #16681.
* base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` insteadHerbert Valerio Riedel2019-03-222-4/+3
| | | | | | As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail Coauthored-by: Ben Gamari <ben@well-typed.com>
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-155-7/+7
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* base: Allow fusion for zip7 and relatedAlexandre2019-02-241-0/+2
| | | | | | | | | | | | | | | | | | 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
* Add comments about how zip fusionSimon Peyton Jones2019-02-201-0/+4
| | | | | | Alexandre Balde (rockbmb) points out that the fusion technology for foldr2, zip, zipWith, etc is undocumented. This patch adds comments to explain.
* Remove OPTIONS_HADDOCK hide in favour for not-homeAdam Sandberg Eriksson2019-01-062-2/+2
| | | | GHC Trac Issues: #15447
* make QSem and QSemN newtypeschessai2018-12-172-5/+2
| | | | | | | | | | | | Reviewers: RyanGlScott, ekmett, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15995 Differential Revision: https://phabricator.haskell.org/D5456
* Doc-only fixesAlec Theriault2018-11-224-20/+18
| | | | | | * laws are capitalized definition lists, no emphasis on the labels * adds missing hyperlinks * fixes other misc. Haddock markup issues.