google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.56k stars 106 forks source link

Add blocks to UExpr IR #1272

Closed dougalm closed 1 year ago

dougalm commented 1 year ago

Previously we had blocks in the concrete syntax and in Core but we turned them into nested let expressions during abstract syntax parsing and back again during inference. It wasn't a major problem but it led to some unexpected errors to do with escaping type variables when we tried to implement automatic dependent pair unpacking.

This change might also improve the quality of source location information since it makes UExpr closer to the actual source text.