summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2021-03-14 12:22:04 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-17 19:09:03 -0400
commit26d26974f5d16a3b2c6ec84a739caab10c7d2b07 (patch)
treee6bb784ac9b43ccf9da9b87a4886d76da8a6c6ff /libraries
parent6b10163e0da90dfc0eeb52549598faa2c0527e37 (diff)
downloadhaskell-26d26974f5d16a3b2c6ec84a739caab10c7d2b07.tar.gz
Document how GADT patterns are matched from left-to-right, outside-in
This adds some bullet points to the GHC User's Guide section on `GADTs` to explain some subtleties in how GHC typechecks GADT patterns. In particular, this adds examples of programs being rejected for matching on GADTs in a way that does not mesh with GHC's left-to-right, outside-in order for checking patterns, which can result in programs being rejected for seemingly counterintuitive reasons. (See #12018 for examples of confusion that arose from this.) In addition, now that we have visible type application in data constructor patterns, I mention a possible workaround of using `TypeApplications` to repair programs of this sort. Resolves #12018.
Diffstat (limited to 'libraries')
0 files changed, 0 insertions, 0 deletions