Functor

Functor#

class discopy.closed.Functor(ob_map=None, ar_map=None, dom=None, cod=None, colour_map=None)[source]#

Bases: discopy.biclosed.Functor, discopy.markov.Functor

A closed functor is a markov functor that preserves evaluation, currying and packing. When the codomain has no products, i.e. its objects have no product method, the functor strictifies: a Product is mapped to the tensor of its factors and Pack, Unpack to the identity. The exception is Drawing where a product is drawn as a single wire and its packing as a box.

Parameters:
  • ob_map (Mapping[Ty, Ty]) – Map from atomic Ty to cod.ob.

  • ar_map (Mapping[Box, Diagram]) – Map from Box to cod.

  • cod (Category) – The codomain of the functor.

dom#

alias of Diagram

cod#

alias of Diagram