- 07 Aug, 2019 1 commit
-
-
Ben Gamari authored
This reverts commit 4e1dfc37. Due to #16943.
-
- 03 May, 2019 1 commit
-
-
Sven Tennie authored
Use `\min` instead of `min` to typeset it as an operator.
-
- 18 Apr, 2019 1 commit
-
-
Sven Tennie authored
E.g. use `\(\mathcal{O}(n^2)\)` instead of `/O(n^2)/`.
-
- 15 Mar, 2019 1 commit
-
-
Ryan Scott authored
This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
-
- 24 Feb, 2019 1 commit
-
-
Alexandre R. Baldé authored
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
-
- 20 Feb, 2019 1 commit
-
-
Simon Peyton Jones authored
Alexandre Balde (rockbmb) points out that the fusion technology for foldr2, zip, zipWith, etc is undocumented. This patch adds comments to explain.
-
- 18 Dec, 2018 1 commit
-
-
Sven Tennie authored
Namely for: - stripPrefix - isPrefixOf - intersperse - tails - map - scanl - scanl1 - scanl' - scanr - scanr1 - zip - zipWith Add examples to `zipWith` and `map`.
-
- 14 Dec, 2018 1 commit
-
-
Sven Tennie authored
Describe complexity and add an example for `GHC.List.filter`.
-
- 08 Dec, 2018 1 commit
-
-
Sven Tennie authored
Namely for: - head - uncons - tail - last - init - null
-
- 06 Dec, 2018 1 commit
-
-
Tobias Decking authored
This patch will allow `zip3` and `zipWith3` in `GHC.List` as well as `zipWith4`, `zipWith5`, `zipWith6` and `zipWith7` in `Data.OldList` to fuse. These rules are kept in a similar style as the rules for `zip` and `zipWith`. Added a corresponding test case. Test Plan: validate Reviewers: hvr, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rockbmb, rwbarton, carter GHC Trac Issues: #15263 Differential Revision: https://phabricator.haskell.org/D5241
-
- 06 Aug, 2018 1 commit
-
-
Simon Jakobi authored
The unhidden module GHC.OldList recommends using GHC.List instead. In consequence we should also have haddocks for GHC.List. (cherry picked from commit e3df129c8bf4c35693d01ea66238882f3e3b6fe1)
-
- 12 Jul, 2018 1 commit
-
-
David Sanders authored
-
- 29 May, 2018 1 commit
-
-
taylorfausak authored
-
- 19 Sep, 2017 1 commit
-
-
Tao He authored
Reviewers: austin, hvr, bgamari, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #14224 Differential Revision: https://phabricator.haskell.org/D3986
-
- 25 Aug, 2017 1 commit
-
-
Ben Gamari authored
Summary: This closes the nearly-eight-year-old #3474. Test Plan: Validate Reviewers: RyanGlScott, austin, hvr Subscribers: rwbarton, thomie GHC Trac Issues: #3474 Differential Revision: https://phabricator.haskell.org/D3870
-
- 19 Aug, 2017 2 commits
-
-
Ben Gamari authored
This was not ready to commit. This reverts commit 8e5b6ec6.
-
Ben Gamari authored
This closes the nearly-eight-year-old #3474.
-
- 29 Apr, 2017 1 commit
-
-
Ben Gamari authored
Our new CPP linter enforces this.
-
- 10 Mar, 2017 1 commit
-
-
Simon Peyton Jones authored
-
- 10 Jan, 2017 1 commit
-
-
takano-akio authored
When fusion rules successfully fire, we are left with calls to *FB functions. They are higher-order functions, and therefore they often benefit from inlining. This is particularly important when then final consumer is a strict fold (foldl', length, etc.), because not inlining these functions means allocating a function closure for each element in the list, which often is more costly than what fusion eliminates. Nofib shows a slight increase in the binary size: ------------------------------------------------------------------------ Program Size Allocs Runtime Elapsed TotalMem ------------------------------------------------------------------------ gen_regexps -0.3% 0.0% 0.000 0.000 0.0% puzzle +0.8% 0.0% 0.089 0.090 0.0% reptile +0.8% -0.0% 0.008 0.008 0.0% ------------------------------------------------------------------------ Min -0.3% -0.0% -7.3% -7.1% 0.0% Max +0.8% +0.0% +7.8% +7.7% +1.8% Geometric Mean +0.0% -0.0% +0.2% +0.2% +0.0% ------------------------------------------------------------------------ Reviewers: simonpj, austin, hvr, bgamari Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2951 GHC Trac Issues: #13001
-
- 24 Sep, 2016 1 commit
-
-
Joachim Breitner authored
as the latter is the official, correct spelling, and the former just a misspelling accepted by GHC. Also document in the user’s guide that the alternative spelling is accepted This commit was brough to you by HIW 2016.
-
- 08 Apr, 2016 1 commit
-
-
Joachim Breitner authored
-
- 23 Dec, 2015 1 commit
-
-
Eric Seidel authored
This introduces "freezing," an operation which prevents further locations from being appended to a CallStack. Library authors may want to prevent CallStacks from exposing implementation details, as a matter of hygiene. For example, in ``` head [] = error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` including the call-site of `error` in `head` is not strictly necessary as the error message already specifies clearly where the error came from. So we add a function `freezeCallStack` that wraps an existing CallStack, preventing further call-sites from being pushed onto it. In other words, ``` pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack ``` Now we can define `head` to not produce a CallStack at all ``` head [] = let ?callStack = freezeCallStack emptyCallStack in error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` --- 1. We add the `freezeCallStack` and `emptyCallStack` and update the definition of `CallStack` to support this functionality. 2. We add `errorWithoutStackTrace`, a variant of `error` that does not produce a stack trace, using this feature. I think this is a sensible wrapper function to provide in case users want it. 3. We replace uses of `error` in base with `errorWithoutStackTrace`. The rationale is that base does not export any functions that use CallStacks (except for `error` and `undefined`) so there's no way for the stack traces (from Implicit CallStacks) to include user-defined functions. They'll only contain the call to `error` itself. As base already has a good habit of providing useful error messages that name the triggering function, the stack trace really just adds noise to the error. (I don't have a strong opinion on whether we should include this third commit, but the change was very mechanical so I thought I'd include it anyway in case there's interest) 4. Updates tests in `array` and `stm` submodules Test Plan: ./validate, new test is T11049 Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1628 GHC Trac Issues: #11049
-
- 07 Sep, 2015 2 commits
-
-
Joachim Breitner authored
After I have found out that I should look at -ddump-prep and not -ddump-core, I noticed that these days, GHC is perfectly capeable of turning (the equivalent) of foldl to (the equivalent) of foldl' if the operation in question is strict. So instead of using rewrite rules to rewrite maximum to a strictMaximum for certain types, we simply use SPECIALIZE. This also marks maximum/minimum as INLINEABLE, so that client code can get similar specializations, hopefully even automatically. And inded, minimum applied to [Double] produces good code (although due to inlineing, not due to specialization, it seems). I checked (by looking at the core) that this still fixes #10788. Differential revision: https://phabricator.haskell.org/D1229
-
Joachim Breitner authored
This fixes a regression reported in #10788, where due to less inlining compared to earlier versions, we’d get worse code. With the SPECIALIZE, we get the good code, and moreover, the good code is in List.hs and _not_ inlined to the use site, so smaller code size and less compilation time.
-
- 04 Sep, 2015 1 commit
-
-
Joachim Breitner authored
Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830. Differential Revision: https://phabricator.haskell.org/D1205
-
- 24 Apr, 2015 1 commit
-
-
Joachim Breitner authored
by eta-expanding its definition so that GHC optmizes the foldl here. Also make sure that other uses of last go via foldl as well, to allow list fusion (tested in T9339). Fixes #10260.
-
- 23 Jan, 2015 1 commit
-
-
David Feuer authored
Also remove foldr2/right rule to avoid possibly introducing bottoms with rules. This effectively reverts most of 488e95b4 Reviewed By: nomeata Differential Revision: https://phabricator.haskell.org/D602
-
- 16 Dec, 2014 1 commit
-
-
Herbert Valerio Riedel authored
Starting with Haddock 2.16 there's a new built-in support for since-annotations Note: This exposes a bug in the `@since` implementation (see e.g. `Data.Bits`)
-
- 07 Nov, 2014 1 commit
-
-
Herbert Valerio Riedel authored
This commit mostly converts literate comments into ordinary Haskell comments or sometimes even Haddock comments, while also removing literate comments in a few cases where they don't make much sense anymore. Moreover, in a few cases trailing whitespaces were removed as well. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D456
-
- 02 Nov, 2014 1 commit
-
-
Joachim Breitner authored
This increases the chance of good code after fusing a left fold. See ticket #7994 and the new Note [Left folds via right fold] Differential Revision: https://phabricator.haskell.org/D393
-
- 29 Oct, 2014 2 commits
-
-
David Feuer authored
Rewrite `take` more aggressively for fusion. Add some more explicit strictness to `unsafeTake` and `unsafeDrop` that seems to help code size and allocation just a drop in some nofib tests. They were not previously strict in their numerical arguments, but always called in contexts where those had been forced; it didn't make a difference in simple test cases, but made a small difference for nofib. See #9740. Differential Revision: https://phabricator.haskell.org/D394
-
David Feuer authored
Rearrange some oddly placed code. Modify `take` to make the fold unconditionally strict in the passed `Int`. This clears up the `fft2` regression. This fixes #9740. Differential Revision: https://phabricator.haskell.org/D390
-
- 28 Oct, 2014 2 commits
-
-
David Feuer authored
This gets rid of all hand-unboxing in `GHC.List` and moves `Foldable` requirements from `Data.OldList` into `GHC.List` (preparatory work for addressing #9716). Specifically, this moves the definition of `maximum`, `minimum`, `foldl'`, `foldl1`, `foldl1'`, `sum`, and `product` into `GHC.List` (which now needs to import `GHC.Num`) Make `take`, `drop`, `length`, and `!!` generally saner (see also #9510) Performance overall seems minimally affected. Some things go up; some things go down; nothing moves horribly much. The code is much easier to read. Differential Revision: https://phabricator.haskell.org/D380
-
Joachim Breitner authored
When investigating a case of unexpected Call Arity failure I noticed that iterateFB would not inline as far as desired, as it is recursive. This patch makes it non-recursive (with a local go), which seem so do great good.
-
- 21 Oct, 2014 1 commit
-
-
David Feuer authored
Summary: Fix #9537 precisely as Joachim Breitner proposed in http://www.haskell.org/pipermail/haskell-cafe/2011-December/097228.html Reviewers: austin, nomeata Reviewed By: austin, nomeata Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D348 GHC Trac Issues: #9537
-
- 08 Oct, 2014 1 commit
-
-
Joachim Breitner authored
Summary: Rewrites takeWhile to a build/foldr form; fuses repeated applications of takeWhile. Reviewers: nomeata, austin Reviewed By: nomeata Subscribers: thomie, carter, ezyang, simonmar Projects: #ghc Differential Revision: https://phabricator.haskell.org/D322 GHC Trac Issues: #9132
-
- 07 Oct, 2014 1 commit
-
-
David Feuer authored
Summary: Make scanl a good producer and a good consumer for fold/build fusion. Add strictly-accumulating scanl', which is required for Data.List.inits. Reviewers: nomeata, austin Reviewed By: austin Subscribers: spacekitteh, thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D314 GHC Trac Issues: #9356
-
- 01 Oct, 2014 2 commits
-
-
David Feuer authored
This fixes #9355.
-
David Feuer authored
in order to make its RULES semantics preserving. This fixes #9495.
-