Ty#

class discopy.biclosed.Ty(*inside)[source]#

Bases: discopy.monoidal.Ty

A biclosed type is a monoidal type that can be exponentiated.

Parameters:

inside (Ty) – The objects inside the type.

Note

Applying a biclosed type to a callable yields a Abstraction, applying it to a string yields a Constant.

property is_exp#

Whether the type is an Exp object.

Example

>>> x, y = Ty('x'), Ty('y')
>>> assert (x ** y).is_exp and (x ** y @ Ty()).is_exp
property is_over#

Whether the type is an Over object.

Example

>>> x, y = Ty('x'), Ty('y')
>>> assert (x << y).is_over and (x << y @ Ty()).is_over
property is_under#

Whether the type is an Under object.

Example

>>> x, y = Ty('x'), Ty('y')
>>> assert (x >> y).is_under and (x >> y @ Ty()).is_under
property base#

The base of an exponential type, assumes self.is_exp.

property exponent#

The exponent of an exponential type, assumes self.is_exp.

application_factory#

alias of Application

constant_factory#

alias of Constant

exp_factory#

alias of Exp

ob#

alias of Ty

over_factory#

alias of Over

under_factory#

alias of Under

variable_factory#

alias of Variable