-- | Replaces a temporary unit ID reference with the expression it resolves to.
replaceTempUnitEx :: M.Map L2.L2BaseUnitsID L2.L2UnitExpression -> L2.L2UnitExpression -> L2.L2UnitExpression
replaceTempUnitEx m (L2.L2UnitExRef ss buid)
  | Just uex <- M.lookup buid m = uex
replaceTempUnitEx :: M.Map L2.L2BaseUnitsID L2.L2UnitExpression -> L2.L2UnitExpression -> L2.L2UnitExpression
replaceTempUnitEx m (L2.L2UnitExRef ss buid)
  | Just uex <- M.lookup buid m = uex
replaceTempUnitEx m (L2.L2UnitExRef ss buid)
  | Just uex <- M.lookup buid m = uex