[Git][ghc/ghc][master] Totalize `GHC.HsToCore.Match.matchWrappers.initNablasGRHSs`.
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Feb 18 14:00:54 UTC 2025
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
e12d6b39 by M Farkas-Dyck at 2025-02-18T08:57:37-05:00
Totalize `GHC.HsToCore.Match.matchWrappers.initNablasGRHSs`.
Converting from `NonEmpty` to `[]` and back is totally needless.
- - - - -
1 changed file:
- compiler/GHC/HsToCore/Match.hs
Changes:
=====================================
compiler/GHC/HsToCore/Match.hs
=====================================
@@ -859,10 +859,7 @@ matchWrapper ctxt scrs (MG { mg_alts = L _ matches
= map (\(L _ m) -> (ldi_nablas, initNablasGRHSs ldi_nablas (m_grhss m))) ms
initNablasGRHSs :: Nablas -> GRHSs GhcTc b -> NonEmpty Nablas
- initNablasGRHSs ldi_nablas m
- = expectJust "GRHSs non-empty"
- $ NE.nonEmpty
- $ replicate (length (grhssGRHSs m)) ldi_nablas
+ initNablasGRHSs ldi_nablas m = ldi_nablas <$ grhssGRHSs m
{- Note [Long-distance information in matchWrapper]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e12d6b3961adfa8cbb42d40262a1ee5cfaceb609
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e12d6b3961adfa8cbb42d40262a1ee5cfaceb609
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250218/37f7ec8c/attachment.html>
More information about the ghc-commits
mailing list