goldfirere / th-desugar

Desugars Template Haskell abstract syntax to a simpler format without changing semantics
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Partial support for embedded types in expressions/patterns and invisible type patterns #211

Closed RyanGlScott closed 7 months ago

RyanGlScott commented 7 months ago

This is a partial fix for #204 and #205 which adds DTypeE, DTypeP, and DInvisP constructs to the th-desugar AST, which behave exactly like their TypeE, TypeP, and InvisP counterparts in the template-haskell AST. This is only a partial fix, however, because DTypeP and DInvisP are currently only supported in the clauses of function declarations. In particular, DTypeP and DInvisP are not supported in lambda expressions, \case expressions, or \cases expressions. See the "Known limitations" section of the README for more.

In order to add full support for DTypeP and DInvisP, we would first need to implement the design proposed in https://github.com/goldfirere/th-desugar/issues/210. Until then, this is good enough.