FuncDecl#

class hugr.ops.FuncDecl(f_name: str, signature: PolyFuncType, num_out: int = 1)[source]#

Bases: Op

Function declaration operation, defines the signature of a function.

Methods

name

Name of the operation.

port_kind

Get the kind of the given port.

Attributes

num_out

f_name

function name

signature

polymorphic function signature

f_name: str#

function name

name() str[source]#

Name of the operation.

port_kind(port: InPort | OutPort) ValueKind | ConstKind | FunctionKind | CFKind | OrderKind[source]#

Get the kind of the given port.

Example

>>> op = Const(val.TRUE)
>>> op.port_kind(OutPort(Node(0), 0))
ConstKind(Bool)
signature: PolyFuncType#

polymorphic function signature