summaryrefslogtreecommitdiff
path: root/libraries/base
Commit message (Collapse)AuthorAgeFilesLines
* base: add Functor, Applicative, Monad, Alternative, MonadPlus, Generic and ↵Fumiaki Kinoshita2019-07-282-0/+46
| | | | Generic1 instances to Kleisli
* Do not ignore events deletion when events to be added are provided (#16916)Ivan Kasatenko2019-07-211-4/+4
| | | | | | | | | | | Kqueue/kevent implementation used to ignore events to be unsubscribed from when events to be subscribed to were provided. This resulted in a lost notification subscription, when GHC runtime didn't listen for any events, yet the kernel considered otherwise and kept waking up the IO manager thread. This commit fixes this issue by always adding and removing all of the provided subscriptions.
* Added do-notation examples for Functor, Applicative and Monad combinators.Baldur Blöndal2019-07-204-0/+179
|
* testsuite: Mark T4808 as broken in threaded2 wayBen Gamari2019-07-181-1/+1
| | | | As noted in #16909.
* testsuite: Mark hWaitForInput-accurate-stdin as broken in all threaded waysBen Gamari2019-07-181-1/+1
| | | | Previously it was not marked as broken in profthreaded
* Create {Int,Word}32RepJohn Ericson2019-07-171-0/+2
| | | | | | | This prepares the way for making Int32# and Word32# the actual size they claim to be. Updates binary submodule for (de)serializing the new runtime reps.
* rename type parameter in `instance Applicative ((->) a)`, fixing #16928xplorld2019-07-141-1/+1
|
* Expunge #ifdef and #ifndef from the codebaseJohn Ericson2019-07-142-6/+6
| | | | | | | | These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself.
* Remove purely external primopsJohn Ericson2019-07-143-1/+5
| | | | | | | | | | | | The compiler doesn't create uses nor compiles the uses that exist specially. These are just plain C-- FFI. These `await*` ones are especially important to so convert because "true" primops are hard to make platform-specific currently. The other exports are part of this commit so this module always exports something, which avoids silly CPP elsewhere. More will be added later once `foreign import prim` is extended.
* base: Data.Fixed: make HasResolution poly-kinded (#10055, #15622)Ashley Yakeley2019-07-132-6/+17
|
* getExecutablePath: get path from sysctl on FreeBSDFraser Tweedale2019-06-271-0/+47
|
* ghci: Don't rely on resolution of System.IO to base moduleBen Gamari2019-06-222-0/+37
| | | | | | | | | Previously we would hackily evaluate a textual code snippet to compute actions to disable I/O buffering and flush the stdout/stderr handles. This broke in a number of ways (#15336, #16563). Instead we now ship a module (`GHC.GHCi.Helpers`) with `base` containing the needed actions. We can then easily refer to these via `Orig` names.
* Add more newtype-derived instances to Data.Ord.DownFumiaki Kinoshita2019-06-182-4/+26
| | | | | Metric Increase: haddock.base
* Data.Ord: give a field name getDown to DownFumiaki Kinoshita2019-06-183-4/+21
|
* base/Event/Poll: Drop POLLRDHUP enum itemBen Gamari2019-06-161-12/+0
| | | | | | Previously the Event enumeration produced by hsc2hs would sometimes include a currently-unused POLLRDHUP item. This unused binding would result in a build failure. Drop it.
* testsuite: Add assertions that way lists are in fact listsBen Gamari2019-06-152-2/+2
| | | | | | Previously there were a few cases where operations like `omit_ways` were incorrectly passed a single way (e.g. `omit_ways('threaded2')`). This won't work as the author expected.
* testsuite: Skip hDuplicateTo001 in concurrent waysBen Gamari2019-06-151-1/+2
| | | | As noted in #16819, this operation is racy under concurrent execution.
* Implement the -XUnliftedNewtypes extension.Andrew Martin2019-06-145-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* testsuite: A more portable solution to #9399Ben Gamari2019-06-136-25/+23
| | | | | | | | Previously we used an awful hybrid batch script/Bourne shell script to allow this test to run both on Windows and Linux (fixing #9399). However, this breaks on some libc implementations (e.g. musl). Fix this. Fixes #16798.
* testsuite: Mark T13167 as fragile in threaded2Ben Gamari2019-06-121-1/+1
| | | | As noted in #16536.
* testsuite: Mark hWaitForInput-accurate-stdin as broken in threaded waysBen Gamari2019-06-121-1/+1
| | | | As noted in #16535.
* base: Mark CPUTime001 as fragileBen Gamari2019-06-101-1/+1
| | | | | | As noted in #16224, CPUTime001 has been quite problematic, reporting non-monotonic timestamps in CI. Unfortunately I've been unable to reproduce this locally.
* Introduce log1p and expm1 primopschessai2019-06-091-13/+9
| | | | | Previously log and exp were primitives yet log1p and expm1 were FFI calls. Fix this non-uniformity.
* Explain that 'mappend' and '(<>)' should be the same [skip ci]Alexandre Baldé2019-06-091-0/+3
|
* base: Export FinalizersBen Gamari2019-06-071-0/+1
| | | | As requested in #16750.
* remove backticks from markup - it doesn't mean what I think it meanscode5hot2019-06-071-1/+1
|
* Used terminology from a paper. Added it as a reference.code5hot2019-06-071-3/+4
|
* Update Traversable.hs with a note about an intuitive lawcode5hot2019-06-071-1/+7
|
* Fix isValidNatural: The BigNat in NatJ# must have at least 2 limbsSimon Jakobi2019-06-075-1/+18
| | | | | | Previously the `integer-gmp` variant of `isValidNatural` would fail to detect values `<= maxBound::Word` that were incorrectly encoded using the `NatJ#` constructor.
* Improve ThreadId Show instanceNathan Collins2019-05-311-2/+2
| | | | By making it include parens when a derived instance would. For example, this changes the (hypothetical) code `show (Just (ThreadId 3))` to produce `"Just (ThreadId 3)"` instead of the current `"Just ThreadId 3"`.
* Implement (Functor.<$) for Data.Functor.{Compose,Product,Sum}Simon Jakobi2019-05-313-0/+5
| | | | | This allows us to make use of the (<$) implementations of the underlying functors.
* Implement (Functor.<$) for ArraySimon Jakobi2019-05-311-0/+9
|
* Don't lose parentheses in show SomeAsyncExceptionNathan Collins2019-05-291-1/+1
|
* base: Include (<$) in all exports of FunctorSimon Jakobi2019-05-272-3/+2
| | | | | | | Previously the haddocks for Control.Monad and Data.Functor gave the impression that `fmap` was the only Functor method. Fixes #16681.
* Add a `NOINLINE` pragma on `someNatVal` (#16586)Iavor Diatchki2019-05-232-0/+62
| | | | This fixes #16586, see `Note [NOINLINE someNatVal]` for details.
* Revert "Add Generic tuple instances up to 15-tuple" #16688David Eichmann2019-05-231-48/+0
| | | | | | This reverts commit 5eb9445444c4099fc9ee0803ba45db390900a80f. It has caused an increase in variance of performance test T9630, causing CI to fail.
* Fix doc for Data.Function.fix.Javran Cheng2019-05-211-1/+1
| | | | Doc-only change.
* Add Generic tuple instances up to 15-tupleOleg Grenrus2019-05-101-0/+48
| | | | | | | | Why 15? Because we have Eq instances up to 15. Metric Increase: T9630 haddock.base
* stg_floatToWord32zh: zero-extend the Word32 (#16617)Kevin Buhr2019-05-081-1/+2
| | | | | | | The primop stgFloatToWord32 was sign-extending the 32-bit word, resulting in weird negative Word32s. Zero-extend them instead. Closes #16617.
* Fix #16603 by documenting some important changes in changelogsRyan Scott2019-05-081-0/+8
| | | | | | This addresses some glaring omissions from `libraries/base/changelog.md` and `docs/users_guide/8.8.1-notes.rst`, fixing #16603 in the process.
* [ typo ] 'castFloatToWord32' -> 'castFloatToWord64'gallais2019-05-041-1/+1
| | | Probably due to a copy/paste gone wrong.
* Typeset Big-O complexities with Tex-style notation (#16090)Sven Tennie2019-05-032-4/+4
| | | | Use `\min` instead of `min` to typeset it as an operator.
* Update autoconf scriptsBen Gamari2019-04-252-1598/+1732
| | | | Scripts taken from autoconf a8d79c3130da83c7cacd6fee31b9acc53799c406
* Typeset Big-O complexities with Tex-style notation (#16090)Sven Tennie2019-04-177-68/+69
| | | | E.g. use `\(\mathcal{O}(n^2)\)` instead of `/O(n^2)/`.
* base: Better document implementation implications of Data.TimeoutBen Gamari2019-04-131-16/+25
| | | | | | | | | | As noted in #16546 timeout uses asynchronous exceptions internally, an implementation detail which can leak out in surprising ways. Note this fact. Also expose the `Timeout` tycon. [skip ci]
* removing x87 register support from native code genCarter Schonwald2019-04-102-17/+4
| | | | | | | | | | | | | | | | * simplifies registers to have GPR, Float and Double, by removing the SSE2 and X87 Constructors * makes -msse2 assumed/default for x86 platforms, fixing a long standing nondeterminism in rounding behavior in 32bit haskell code * removes the 80bit floating point representation from the supported float sizes * theres still 1 tiny bit of x87 support needed, for handling float and double return values in FFI calls wrt the C ABI on x86_32, but this one piece does not leak into the rest of NCG. * Lots of code thats not been touched in a long time got deleted as a consequence of all of this all in all, this change paves the way towards a lot of future further improvements in how GHC handles floating point computations, along with making the native code gen more accessible to a larger pool of contributors.
* Use ghc-prim < 0.7, not <= 0.6.1, as upper version boundsRyan Scott2019-04-091-1/+1
| | | | | | | Using `ghc-prim <= 0.6.1` is somewhat dodgy from a PVP point of view, as it makes it awkward to support new minor releases of `ghc-prim`. Let's instead use `< 0.7`, which is the idiomatic way of expressing PVP-compliant upper version bounds.
* testsuite: Add testcase for #16111Ben Gamari2019-04-043-0/+16
|
* Replace git.haskell.org with gitlab.haskell.org (#16196)Yuriy Syrovetskiy2019-04-041-1/+1
|
* Inline the definition of 'ap' in the Monad lawsChris Martin2019-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The law as it is currently written is meaningless, because nowhere have we defined the implementation of 'ap'. The reader of the Control.Monad documentation is provided with only a type signature, > ap :: Monad m => m (a -> b) -> m a -> m b an informal description, > In many situations, the liftM operations can be replaced by uses of > ap, which promotes function application. and a relationship between 'ap' and the 'liftM' functions > return f `ap` x1 `ap` ... `ap` xn > is equivalent to > liftMn f x1 x2 ... xn Without knowing how 'ap' is defined, a law involving 'ap' cannot provide any guidance for how to write a lawful Monad instance, nor can we conclude anything from the law. I suspect that a reader equipped with the understanding that 'ap' was defined prior to the invention of the Applicative class could deduce that 'ap' must be defined in terms of (>>=), but nowhere as far as I can tell have we written this down explicitly for readers without the benefit of historical context. If the law is meant to express a relationship among (<*>), (>>=), and 'return', it seems that it is better off making this statement directly, sidestepping 'ap' altogether.