recursivelyImportExternalClassExpression :: L2.L2Model -> L2.Identifier -> L2.L2ClassExpression -> ModelTranslation L2.L2ClassExpression
recursivelyImportExternalClassExpression foreignMod foreignURL clsex =
  case clsex of
    L2.L2ClassExpressionReference ss clsid -> L2.L2ClassExpressionReference ss <$>
                                                recursivelyImportExternalClass foreignMod foreignURL clsid
    L2.L2ClassExpressionOpenDisjointUnion ss labs ->
      L2.L2ClassExpressionOpenDisjointUnion ss <$>
        recursivelyImportExternalLabelledDomains foreignMod foreignURL labs
    L2.L2ClassExpressionList ss exs ->
      L2.L2ClassExpressionList ss <$> mapM (recursivelyImportExternalClassExpression foreignMod foreignURL) exs
recursivelyImportExternalClassExpression :: L2.L2Model -> L2.Identifier -> L2.L2ClassExpression -> ModelTranslation L2.L2ClassExpression
recursivelyImportExternalClassExpression foreignMod foreignURL clsex =
  case clsex of
    L2.L2ClassExpressionReference ss clsid -> L2.L2ClassExpressionReference ss <$>
                                                recursivelyImportExternalClass foreignMod foreignURL clsid
    L2.L2ClassExpressionOpenDisjointUnion ss labs ->
      L2.L2ClassExpressionOpenDisjointUnion ss <$>
        recursivelyImportExternalLabelledDomains foreignMod foreignURL labs
    L2.L2ClassExpressionList ss exs ->
      L2.L2ClassExpressionList ss <$> mapM (recursivelyImportExternalClassExpression foreignMod foreignURL) exs
recursivelyImportExternalClassExpression foreignMod foreignURL clsex =
  case clsex of
    L2.L2ClassExpressionReference ss clsid -> L2.L2ClassExpressionReference ss <$>
                                                recursivelyImportExternalClass foreignMod foreignURL clsid
    L2.L2ClassExpressionOpenDisjointUnion ss labs ->
      L2.L2ClassExpressionOpenDisjointUnion ss <$>
        recursivelyImportExternalLabelledDomains foreignMod foreignURL labs
    L2.L2ClassExpressionList ss exs ->
      L2.L2ClassExpressionList ss <$> mapM (recursivelyImportExternalClassExpression foreignMod foreignURL) exs