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

Make `buildScoped` take a second continuation to consume the decls from below. #1319

Closed dougalm closed 1 year ago

dougalm commented 1 year ago

That is, instead of returning an Abs decls result, it accepts a continuation that takes decls and e as arguments, with the decls in scope in the env. This avoids having to use refreshAbs. It wasn't a problem previously because decls only appeared in blocks, so there was only an Atom beneath them. But that will change when we add decls to binders.