translateDomainExpressionCrossScope scope _ nsid (L1.L1DomainExpressionApply ss args value) = do
  let processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Left dex) = do
        domArg <- ((,) (L2.L2ScopedDomainID sdName 0)) <$>
                    translateDomainExpression scope ss nsid dex
        return (domArg : domArgs, unitArgs)
      processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Right uex) = do
        unitArg <- (,) (L2.L2ScopedUnitID sdName 0)  <$> translateUnitExpression scope ss nsid uex
        return (domArgs, unitArg : unitArgs)
  (domArgs, unitArg : unitArgs) <- foldM processOneArg ([], []) args
  (,)
    <$> (L2.L2DomainExpressionApply ss domArgs unitArgs <$> translateDomainExpression scope ss nsid value)
    <*> (pure scope)
translateDomainExpressionCrossScope scope _ nsid (L1.L1DomainExpressionApply ss args value) = do
  let processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Left dex) = do
        domArg <- ((,) (L2.L2ScopedDomainID sdName 0)) <$>
                    translateDomainExpression scope ss nsid dex
        return (domArg : domArgs, unitArgs)
      processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Right uex) = do
        unitArg <- (,) (L2.L2ScopedUnitID sdName 0)  <$> translateUnitExpression scope ss nsid uex
        return (domArgs, unitArg : unitArgs)
  (domArgs, unitArg : unitArgs) <- foldM processOneArg ([], []) args
  (,)
    <$> (L2.L2DomainExpressionApply ss domArgs unitArgs <$> translateDomainExpression scope ss nsid value)
    <*> (pure scope)
translateDomainExpressionCrossScope scope _ nsid (L1.L1DomainExpressionApply ss args value) = do
  let processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Left dex) = do
        domArg <- ((,) (L2.L2ScopedDomainID sdName 0)) <$>
                    translateDomainExpression scope ss nsid dex
        return (domArg : domArgs, unitArgs)
      processOneArg (domArgs, unitArgs) (L1.L1ScopedID _ sdName, Right uex) = do
        unitArg <- (,) (L2.L2ScopedUnitID sdName 0)  <$> translateUnitExpression scope ss nsid uex
        return (domArgs, unitArg : unitArgs)
  (domArgs, unitArg : unitArgs) <- foldM processOneArg ([], []) args
  (,)
    <$> (L2.L2DomainExpressionApply ss domArgs unitArgs <$> translateDomainExpression scope ss nsid value)
    <*> (pure scope)