johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
222 stars 11 forks source link

improve TypedExpr.substitute and Declaration.substitute #1126

Open johnynek opened 5 months ago

johnynek commented 5 months ago

The unshadow algorithm in Code.Lambda added in this commit: https://github.com/johnynek/bosatsu/pull/1124/commits/dc5389bea86bbd3910e07ed1c230c66c52355934

could be used in TypedExpr and Declaration. Both of which give up and return None if they hit a condition where it is needed.

By making that change, we could make those functions always return, which could improve optimizations.