| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* laws are capitalized definition lists, no emphasis on the labels
* adds missing hyperlinks
* fixes other misc. Haddock markup issues.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
As reported by tabaqui on `#hackage`
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, hvr, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: adamse, RyanGlScott, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3416
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I was initially confused when I read "zipWithn" in the haddock for
ZipList, went looking for a function named "zipWithn", and found that
it didn't exist. This expands the docs to clarify that we're referring
to the family of functions [zipWith, zipWith3, zipWith4, ...],
capitalizes the letter "n" in "zipWithN" in attempt to make that more
readable, and gives an example.
I also moved this documentation from ZipList itself to the Applicative
instance, so that it will show up in both the Ziplist documentation and
in the list of Applicative instances.
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3324
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, hvr, bgamari, dfeuer
Reviewed By: dfeuer
Subscribers: dfeuer, thomie
Differential Revision: https://phabricator.haskell.org/D3284
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make `liftA2` a method of `Applicative`.
* Add explicit `liftA2` definitions to instances in `base`.
* Add explicit invocations in `base`.
Reviewers: ekmett, bgamari, RyanGlScott, austin, hvr
Reviewed By: RyanGlScott
Subscribers: ekmett, RyanGlScott, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add @since annotations to instances in `base`.
Test Plan:
* ./validate # some commets shouldn't break the build
* review the annotations for absurdities.
Reviewers: ekmett, goldfire, RyanGlScott, austin, hvr, bgamari
Reviewed By: RyanGlScott, hvr, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2277
GHC Trac Issues: #11767
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Const` from `Control.Applicative` can trivially be made
kind-polymorphic in its second argument. There has been a Trac issue
about this for nearly a year now. It doesn't look like anybody objects
to it, so I figured I might as well make a patch.
Trac Issues: #10039, #10865, #11135
Differential Revision: https://phabricator.haskell.org/D1630
Reviewers: ekmett, hvr, bgamari
Subscribers: RyanGlScott, thomie
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactors `(>>)`/`(*>)`/`return`/`pure` methods into normal form.
The redundant explicit `return` method definitions are dropped
altogether.
The explicit `(>>) = (*>)` definitions can't be removed yet, as
the default implementation of `(>>)` is still in terms of `(*>)`
(even though that should have been changed according to the AMP but
wasn't -- see note in GHC.Base for details why this had to be postponed)
A nofib comparision shows this refactoring to result in minor runtime
improvements (unless those are within normal measurement fluctuations):
Program Size Allocs Runtime Elapsed TotalMem
-------------------------------------------------------------------------
Min -0.0% -0.0% -1.6% -3.9% -1.1%
Max -0.0% +0.0% +0.5% +0.5% 0.0%
Geometric Mean -0.0% -0.0% -0.4% -0.5% -0.0%
Full `nofib` report at https://phabricator.haskell.org/P68
Reviewers: quchen, alanz, austin, #core_libraries_committee, bgamari
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D1316
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to #9858 `Typeable` doesn't need to be explicitly derived anymore.
This also makes `AutoDeriveTypeable` redundant, as well as some imports of
`Typeable` (removal of whose may be beneficial to #9707). This commit
removes several such now redundant use-sites in `base`.
Reviewed By: austin, ekmett
Differential Revision: https://phabricator.haskell.org/D712
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As suggested in
https://www.haskell.org/pipermail/libraries/2013-October/021531.html
this adds the following instances
- `Show a => Show (Const a b)`
- `Read a => Read (Const a b)`
- `Eq a => Eq (Const a b)`
- `Ord a => Ord (Const a b)`
The Read/Show instances are defined in such a way as if `Const` was defined
without record-syntax (i.e. as `newtype Const a b = Const a`)
Addresses #9984
Reviewed By: ekmett
Differential Revision: https://phabricator.haskell.org/D619
|
| |
|
|
|
|
|
|
|
|
|
| |
Control.Applicative previously imported `(.)` and `id` from `Control.Arrow`,
but then only applied them to functions.
Reviewed By: ekmett, hvr
Differential Revision: https://phabricator.haskell.org/D462
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generally clean up things relating to Applicative and Monad in `GHC.Base`
and `Control.Applicative` to make `Applicative` feel like a bit more of a
first-class citizen rather than just playing second fiddle to `Monad`. Use
`coerce` and GND to improve performance and clarity.
Change the default definition of `(*>)` to use `(<$)`, in case the
`Functor` instance optimizes that.
Moreover, some manually written instances are made into compiler-derived
instances.
Finally, this also adds a few AMP-related laws to the `Applicative` docstring.
NOTE: These changes result in a 13% decrease in allocation for T9020
Reviewed By: ekmett, hvr
Differential Revision: https://phabricator.haskell.org/D432
|
|
|
|
|
|
|
|
|
| |
This is the last preparation needed before generalizing entities in
Control.Monad conflicting with those from Data.Foldable (re #9586)
Reviewed By: ekmett, austin
Differential Revision: https://phabricator.haskell.org/D225
|
|
|
|
|
|
|
|
|
|
|
| |
This is necessary in order to invert the import-dependency between
Data.Foldable and Control.Monad (for addressing #9586)
This also updates the `binary` submodule to qualify a GHC.Base import
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes *only* the type-classes w/o any of their methods.
This is the very first step for implementing BPP (see #9586), which
already requires breaking up several import-cycles leading back to `Prelude`.
Ideally, importing `Prelude` should be avoided in most `base` modules,
as `Prelude` does not define any entities, but rather re-exports
existing ones.
Test Plan: validate passes
Reviewers: ekmett, austin
Reviewed By: ekmett, austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D209
GHC Trac Issues: #9586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This includes pretty much all the changes needed to make `Applicative`
a superclass of `Monad` finally. There's mostly reshuffling in the
interests of avoid orphans and boot files, but luckily we can resolve
all of them, pretty much. The only catch was that
Alternative/MonadPlus also had to go into Prelude to avoid this.
As a result, we must update the hsc2hs and haddock submodules.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: Build things, they might not explode horribly.
Reviewers: hvr, simonmar
Subscribers: simonmar
Differential Revision: https://phabricator.haskell.org/D13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This was proposed in 2011 [1] with no serious objections although wasn't
implemented until it was again mentioned in 2014 [2].
[1] http://www.haskell.org/pipermail/libraries/2011-January/015552.html
[2] http://www.haskell.org/pipermail/libraries/2014-June/023228.html
Test Plan: None
Reviewers: austin
Reviewed By: austin
Subscribers: hvr, phaskell, simonmar, relrod, carter, ekmett
Differential Revision: https://phabricator.haskell.org/D81
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted in the ticket, there's no particular reason why there aren't
Generic, Typeable, and Data instances for the types in the
Monoid/Applicative modules.
Furthermore, Product and Sum should also have Num instances as well as
Edward noted.
Aside from that, this patch also changes the dependency chain slightly -
it moves the Monoid Proxy instance into Data.Monoid and out of
Data.Proxy.
Why? Cycles (of course). Monoid depends on Typeable. Typeable uses
Proxy. Proxy uses Monoid. Boom. Luckily, Proxy only depends on Monoid
outside of the GHC namespace, so the fix is easy and clean.
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
| |
This (arguably) improves rendering with Haddock 2.14
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
| |
For more details, see original proposal at
http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/20369
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now that HUGS and NHC specific code has been removed, this commit "folds"
the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This
renders `base` officially GHC only.
This commit also removes redundant `{-# LANGUAGE CPP #-}`.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
| |
Patch from merijn.
|
| |
|
|
|
|
| |
Added Applicative and Alternative instances for ReadP and ReadPrec Added Functor, Applicative, Alternative and MonadPlust instances for ArrowMonadx
|
| |
|
| |
|
| |
|
|
|
|
| |
following a suggestion of Russell O'Connor on the libraries list.
|
|
|
|
|
|
|
|
|
|
| |
Add explicit {-# LANGUAGE xxx #-} pragmas to each module, that say
what extensions that module uses. This makes it clearer where
different extensions are used in the (large, variagated) base package.
Now base.cabal doesn't need any extensions field
Thanks to Bas van Dijk for doing all the work.
|
| |
|
| |
|
|
|
|
| |
patch from Bas van Dijk
|
|
|
|
|
| |
This is not the only possible instance for Either, but this one is
compatible with the usual Monad instance.
|
| |
|
|
|
|
|
|
| |
Fri Oct 9 14:50:51 BST 2009 Malcolm.Wallace@cs.york.ac.uk
GHC (correctly) warns about the unused import, which breaks the validate
build.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(proposal #3335)
The following functions
(<$) :: Functor f => a -> f b -> f a
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
are moved into the corresponding classes, with the existing implementations
as default definitions. This gives people creating instances the option of
defining specialized implementations of these functions, though they should
be equivalent to the default definitions.
Although (<$) is now a method of the Functor class, it is hidden in the
re-export by the Prelude, Control.Monad and Monad. The new module
Data.Functor exposes the full class, plus the function (<$>). These are
also re-exported by Control.Applicative.
|
|
|
|
|
| |
These unused imports are detected by the new unused-import code
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The Compositor class is a superclass of Arrow.
|