ddc-core-simpl-0.3.2.1: Disciplined Disciple Compiler code transformations.

Safe HaskellSafe-Inferred

DDC.Core.Transform.Bubble

Description

Bubble casts outwards. We float casts up and outwards so they are just inside the inner-most enclosing let. This way the functions still have the same effect and closure, but the casts don't get in the way of subsequent transforms.

Synopsis

Documentation

bubbleModule :: Ord n => Module a n -> Module a nSource

Bubble casts outwards in a Module.

bubbleX :: Ord n => KindEnv n -> TypeEnv n -> Exp a n -> Exp a nSource

Bubble casts outwards in an Exp.