GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:39:46Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9623Use Data.List.dropWhileEnd2019-07-07T18:39:46ZDavid FeuerUse Data.List.dropWhileEndThe GHC tree has many instances of `reverse . dropWhile ... . reverse`. As well as being harder to read and work with (searching for those forms led me to discover #9616) this approach is less efficient than `dropWhileEnd`. I think I've ...The GHC tree has many instances of `reverse . dropWhile ... . reverse`. As well as being harder to read and work with (searching for those forms led me to discover #9616) this approach is less efficient than `dropWhileEnd`. I think I've found all the places this is used, and I'll submit a patch to fix all the instances except for tests and nofib.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.3 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Use Data.List.dropWhileEnd","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"The GHC tree has many instances of `reverse . dropWhile ... . reverse`. As well as being harder to read and work with (searching for those forms led me to discover #9616) this approach is less efficient than `dropWhileEnd`. I think I've found all the places this is used, and I'll submit a patch to fix all the instances except for tests and nofib.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9754Fix Applicative instances in the wake of AMP2019-07-07T18:39:11ZDavid FeuerFix Applicative instances in the wake of AMPI haven't tracked down all the problems yet, but several experiments leading to validation failures strongly suggest that some `Applicative` instances in the GHC tree fail to interact properly with their associated `Monad` instances. Tha...I haven't tracked down all the problems yet, but several experiments leading to validation failures strongly suggest that some `Applicative` instances in the GHC tree fail to interact properly with their associated `Monad` instances. That is, `ap ≠ (<*>)` and/or `(>>) ≠ (*>)`. We should be able to fix these up by fleshing out the appropriate instance declarations.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.8.3 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Fix Applicative instances in the wake of AMP","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.8.3","keywords":["AMP"],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"I haven't tracked down all the problems yet, but several experiments leading to validation failures strongly suggest that some `Applicative` instances in the GHC tree fail to interact properly with their associated `Monad` instances. That is, `ap ≠ (<*>)` and/or `(>>) ≠ (*>)`. We should be able to fix these up by fleshing out the appropriate instance declarations.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9759Add Alternative wrapper to Data.Monoid2019-07-07T18:39:10ZDavid FeuerAdd Alternative wrapper to Data.MonoidAs discussed on the libraries list,
```hs
-- | Monoid under @<|>@.
newtype Alt f a = Alt {getAlt :: f a}
deriving (Generic, Generic1, Read, Show, Eq, Ord, Num, Enum,
Monad, MonadPlus, Applicative, Alternative, Functor)
in...As discussed on the libraries list,
```hs
-- | Monoid under @<|>@.
newtype Alt f a = Alt {getAlt :: f a}
deriving (Generic, Generic1, Read, Show, Eq, Ord, Num, Enum,
Monad, MonadPlus, Applicative, Alternative, Functor)
instance forall f a . Alternative f => Monoid (Alt f a) where
mempty = Alt empty
mappend = coerce ((<|>) :: f a -> f a -> f a)
```
The documentation for `Data.Monoid.First` and `Data.Monoid.Last` should also be expanded to explain that `First a` is isomorphic to `Alt Maybe a` and `Last a` is isomorphic to `Dual (Alt Maybe a)`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add Alternative wrapper to Data.Monoid","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"As discussed on the libraries list,\r\n\r\n{{{#!hs\r\n-- | Monoid under @<|>@.\r\nnewtype Alt f a = Alt {getAlt :: f a}\r\n deriving (Generic, Generic1, Read, Show, Eq, Ord, Num, Enum,\r\n Monad, MonadPlus, Applicative, Alternative, Functor)\r\n\r\ninstance forall f a . Alternative f => Monoid (Alt f a) where\r\n mempty = Alt empty\r\n mappend = coerce ((<|>) :: f a -> f a -> f a)\r\n}}}\r\n\r\nThe documentation for `Data.Monoid.First` and `Data.Monoid.Last` should also be expanded to explain that `First a` is isomorphic to `Alt Maybe a` and `Last a` is isomorphic to `Dual (Alt Maybe a)`.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9763Implement Foldable methods for Array directly2019-07-07T18:39:09ZDavid FeuerImplement Foldable methods for Array directlyCurrently, they're implemented via conversion to lists. This works out sanely for `foldr` and `foldr1`, after some transformations, but it's rather less sane for left folds. Left folds end up "twisted" like their list counterparts, givin...Currently, they're implemented via conversion to lists. This works out sanely for `foldr` and `foldr1`, after some transformations, but it's rather less sane for left folds. Left folds end up "twisted" like their list counterparts, giving potentially surprising performance characteristics. For `Array`, left and right folds can reasonably be expected to be symmetrical.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Implement Foldable methods for Array directly","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"Currently, they're implemented via conversion to lists. This works out sanely for `foldr` and `foldr1`, after some transformations, but it's rather less sane for left folds. Left folds end up \"twisted\" like their list counterparts, giving potentially surprising performance characteristics. For `Array`, left and right folds can reasonably be expected to be symmetrical.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9781Make list monad operations fuse2019-07-07T18:39:04ZDavid FeuerMake list monad operations fuseWe like to think that `do {x <- xs; y <- f x ; return g y}` is the same as `[g y | x <- xs, y <- f x]`, but the former does not fuse nearly as well. Let's fix that.
<details><summary>Trac metadata</summary>
| Trac field | V...We like to think that `do {x <- xs; y <- f x ; return g y}` is the same as `[g y | x <- xs, y <- f x]`, but the former does not fuse nearly as well. Let's fix that.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Make list monad operations fuse","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"We like to think that `do {x <- xs; y <- f x ; return g y}` is the same as `[g y | x <- xs, y <- f x]`, but the former does not fuse nearly as well. Let's fix that.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9796Implement amap/coerce rule for `Array`2019-07-07T18:39:01ZDavid FeuerImplement amap/coerce rule for `Array`We have `map/coerce`; there's no reason not to have `amap/coerce` as well.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------------------...We have `map/coerce`; there's no reason not to have `amap/coerce` as well.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Implement amap/coerce rule for `Array`","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"We have `map/coerce`; there's no reason not to have `amap/coerce` as well.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9801Make listArray fuse2019-07-07T18:39:00ZDavid FeuerMake listArray fuse`GHC.Arr.listArray` does not currently fuse with a good list producer. Let's make that happen.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -----...`GHC.Arr.listArray` does not currently fuse with a good list producer. Let's make that happen.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Make listArray fuse","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"`GHC.Arr.listArray` does not currently fuse with a good list producer. Let's make that happen.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuerhttps://gitlab.haskell.org/ghc/ghc/-/issues/9827void does not use <$2019-07-07T18:38:54ZDavid Feuervoid does not use <$`Data.Functor.void` is currently defined as
```hs
void = fmap (const ())
```
Some `Functor` instances have an optimized `<$`, so this should be
```hs
void x = () <$ x
```
<details><summary>Trac metadata</summary>
| Trac field ...`Data.Functor.void` is currently defined as
```hs
void = fmap (const ())
```
Some `Functor` instances have an optimized `<$`, so this should be
```hs
void x = () <$ x
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------------------ |
| Version | 7.9 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | core-libraries-committee@haskell.org |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"void does not use <$","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"7.10.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dfeuer"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["core-libraries-committee@haskell.org"],"type":"Task","description":"`Data.Functor.void` is currently defined as\r\n\r\n{{{#!hs\r\nvoid = fmap (const ())\r\n}}}\r\n\r\nSome `Functor` instances have an optimized `<$`, so this should be\r\n\r\n{{{#!hs\r\nvoid x = () <$ x\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1David FeuerDavid Feuer