summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Bifoldable.hs
Commit message (Collapse)AuthorAgeFilesLines
* Correct more doctestsOleg Grenrus2021-01-101-0/+1
|
* Correct doctestsOleg Grenrus2021-01-021-0/+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.
* doc (Bitraversable): Add examples to BitraversableJulien Debon2020-05-081-1/+1
| | | | | | | | * Add examples to Data.Bitraversable * Fix formatting for (,) in Bitraversable and Bifoldable * Fix mistake on bimapAccumR documentation See #17929
* Add doc examples for BifoldableJulien Debon2020-05-081-7/+581
| | | | See #17929
* Doc-only fixesAlec Theriault2018-11-221-2/+6
| | | | | | * laws are capitalized definition lists, no emphasis on the labels * adds missing hyperlinks * fixes other misc. Haddock markup issues.
* Fix ambiguous/out-of-scope Haddock identifiersAlec Theriault2018-08-211-1/+1
| | | | | | | | | | | | | | | | | 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
* Typos in comments (notes too) [ci skip]Gabor Greif2017-03-241-1/+1
|
* Make Data.{Bifoldable,Bitraversable} -XSafeRyan Scott2016-07-201-0/+1
| | | | | | | | | | | | | | | Test Plan: Previously, `Data.{Bifoldable,Bitraversable}` were being inferred as `Unsafe` due to a transitive `Data.Coerce` import from `Data.Functor.Utils`. This rectifies this unfortunate mistake. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie, phadej Differential Revision: https://phabricator.haskell.org/D2412
* Add Bifoldable and Bitraversable to baseRyan Scott2016-06-191-0/+428
This adds `Data.Bifoldable` and `Data.Bitraversable` from the `bifunctors` package to `base`, completing the migration started in D336. This is fairly straightforward, although there were a suprising amount of reinternal organization in `base` that was needed for this to happen: * `Data.Foldable`, `Data.Traversable`, `Data.Bifoldable`, and `Data.Bitraversable` share some nonexported datatypes (e.g., `StateL`, `StateR`, `Min`, `Max`, etc.) to implement some instances. To avoid code duplication, I migrated this internal code to a new hidden module, `Data.Functor.Utils` (better naming suggestions welcome). * `Data.Traversable` and `Data.Bitraversable` also make use of an identity newtype, so I modified them to use `Data.Functor.Identity.Identity`. This has a ripple effect on several other modules, since I had to move instances around in order to avoid dependency cycles. Fixes #10448. Reviewers: ekmett, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2284 GHC Trac Issues: #9682, #10448