You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While in the progress of developing a new translation target, I need to deal with nested patterns, such as
match pair {
(Foo, Foo) => A,
(Foo, Bar) => B,
(Bar, Foo) => C,
(Bar, Bar) => D
}
which, due to restrictions imposed by the target language, I need to restructure as follows:
match fst(pair) {
Foo => match snd(pair) {
Foo => A,
Bar => B
},
Bar => match snd(pair) {
Foo => C,
Bar => D
}
}
I wondered if this logic was already implemented somewhere. I did check the available rewrites, but as far as I can tell, none of them performs this specific transformation. I also experimented with the OCaml and C backends, but based on their output it doesn't look like they require this transformation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While in the progress of developing a new translation target, I need to deal with nested patterns, such as
which, due to restrictions imposed by the target language, I need to restructure as follows:
I wondered if this logic was already implemented somewhere. I did check the available rewrites, but as far as I can tell, none of them performs this specific transformation. I also experimented with the OCaml and C backends, but based on their output it doesn't look like they require this transformation.
Beta Was this translation helpful? Give feedback.
All reactions