[Git][ghc/ghc][master] T2T in Patterns (#23739)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Dec 6 21:14:50 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
0f0c53a5 by Vladislav Zavialov at 2023-12-06T16:14:09-05:00
T2T in Patterns (#23739)

This patch implements the T2T (term-to-type) transformation in patterns.
Patterns that are checked against a visible forall can now be written
without the `type` keyword:

	  \(type t) (x :: t) -> ...   -- old
	  \t (x :: t) -> ...          -- new

The `t` binder is parsed and renamed as a term pattern (Pat), but
then undergoes a conversion to a type pattern (HsTyPat).
See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs

- - - - -


30 changed files:

- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Types/Error/Codes.hs
- testsuite/tests/module/mod132.stderr
- testsuite/tests/module/mod147.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr
- testsuite/tests/rename/should_fail/T18740a.stderr
- testsuite/tests/rename/should_fail/T18740b.stderr
- testsuite/tests/th/T14627.stderr
- testsuite/tests/th/T18740c.stderr
- testsuite/tests/type-data/should_fail/TDExpression.stderr
- testsuite/tests/typecheck/should_fail/T19978.stderr
- + testsuite/tests/vdq-rta/should_compile/T23739_idv.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_nested.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_sig.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_sizeOf.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_symbolVal.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_th_dump1.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_th_dump1.stderr
- + testsuite/tests/vdq-rta/should_compile/T23739_th_pprint1.hs
- + testsuite/tests/vdq-rta/should_compile/T23739_th_pprint1.stderr
- + testsuite/tests/vdq-rta/should_compile/T23739_typeRep.hs
- testsuite/tests/vdq-rta/should_compile/all.T
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.hs
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f0c53a501ba7740cc896bdb3a2b153512183955

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f0c53a501ba7740cc896bdb3a2b153512183955
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/20231206/048b0655/attachment.html>


More information about the ghc-commits mailing list