Merge pull request #208 from HigherOrderCO/bug/sc-471/oall-and-ono-all-reset-the-adt-encoding

[sc-471] Oall and Ono-all reset the adt encoding
This commit is contained in:
imaqtkatt 2024-02-26 11:05:30 -03:00 committed by GitHub
commit 20b01400aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -377,6 +377,16 @@ impl CompileOpts {
}
}
/// Set all opts as true and keep the current adt encoding.
pub fn set_all(self) -> Self {
Self { adt_encoding: self.adt_encoding, ..Self::heavy() }
}
/// Set all opts as false and keep the current adt encoding.
pub fn set_no_all(self) -> Self {
Self { adt_encoding: self.adt_encoding, ..Self::default() }
}
/// All optimizations disabled, except detach supercombinators.
pub fn light() -> Self {
Self { supercombinators: true, ..Self::default() }

View File

@ -306,8 +306,8 @@ impl OptArgs {
let mut opts = CompileOpts::light();
for arg in args {
match arg {
All => opts = CompileOpts::heavy(),
NoAll => opts = CompileOpts::default(),
All => opts = opts.set_all(),
NoAll => opts = opts.set_no_all(),
Eta => opts.eta = true,
NoEta => opts.eta = false,
Prune => opts.prune = true,