pikelet-lang / pikelet

A friendly little systems language with first-class types. Very WIP! 🚧 🚧 🚧
https://pikelet-lang.github.io/pikelet/
Apache License 2.0
610 stars 26 forks source link

Use state methods instead of free functions #213

Closed brendanzab closed 4 years ago

brendanzab commented 4 years ago

This converts the typing and translation pass functions into methods on their State type. I'm unsure if this is an improvement or not!

The short of it is that instead of:

let (core_term, r#type) = surface_to_core::synth_type(&mut state, &surface_term);

you now write:

let (core_term, r#type) = state.synth_type(&surface_term);