Skip to content

Desugar field constructs into their symbolic forms#151

Merged
soareschen merged 2 commits intomainfrom
desugar-symbol
Sep 12, 2025
Merged

Desugar field constructs into their symbolic forms#151
soareschen merged 2 commits intomainfrom
desugar-symbol

Conversation

@soareschen
Copy link
Collaborator

@soareschen soareschen commented Sep 12, 2025

Summary

This PR updates the CGP proc macros to desugar field constructs into their symbolic forms, such as:

  • symbol!("abc") is desugared to ι<'a', ι<'b', ι<'c', ε>>> instead of Char<'a', Char<'b', Char<'c', Nil>>>.
  • Product![a, b, c] is desugard to π<a, π<b, π<c, ε>>> instead of Cons<a, Cons<b, Cons<c, Nil>>>

This change is aimed to simplify the inspection of expanded macro code, so that the desugared field constructs can be more readable inside the macro expansion.

Rename of symbol! to Symbol!

Furthermore, the use of symbol! are replaced with Symbol! (first letter capitalized). This is to align better with the case convention that the code generated from Symbol! is a type, not a value.

Nevertheless, the original symbol! macro is kept in the prelude as an alias to Symbol! for backward compatibility.

@soareschen soareschen merged commit 3221f37 into main Sep 12, 2025
5 checks passed
@soareschen soareschen deleted the desugar-symbol branch September 12, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant