Ty#
- class discopy.biclosed.Ty(*inside)[source]#
Bases:
discopy.monoidal.TyA 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 aConstant.- property is_exp#
Whether the type is an
Expobject.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
Overobject.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
Underobject.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