Hi fellow Haskellers,
I’m working on a compiler project, and currently, there are multiple rewriting passes which traverse the whole AST. The type signatures are all roughly somePass :: forall a . Data a => a -> m a
, where m
is a Monad
instance. The Data
constraint makes it convenient to work with mutually-recursive datatype definitions.
Does there exist some fusion technique so multiple passes can be fused into one to ensure the actual traversal is done only once, to reduce time/space overhead? Thanks.