Returns an expression equal to expression whose data is completely contained in the type domain.

May throw in case Julia isn't able to use a relevant value as a type parameter.

Some properties, should hold for any valid expr:

  • Base.issingletontype(typeof(expression_into_type_domain(expr)))

  • expr == expression_into_type_domain(expr)

expression_new(expression_type::Type, operation, children, metadata)

Returns an expression whose type is based on expression_type, but with children as its immediate children and with operation as its top-level operation.

The metadata argument may carry additional necessary data. Use nothing as the default.