FunctionAsOperation function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Convert

Package: Microsoft.Quantum.Standard

Converts functions to operations.

function FunctionAsOperation<'Input, 'Output> (fn : ('Input -> 'Output)) : ('Input => 'Output)

Description

Given a function, returns an operation which calls that function, and which does nothing else.

Input

fn : 'Input -> 'Output

A function to be converted to an operation.

Output : 'Input => 'Output

An operation op such that op(input) is identical to fn(input) for all input.

Type Parameters

'Input

Input type of the function to be converted.

'Output

Output type of the function to be converted.

Remarks

This is mainly useful for passing functions to functions or operations which expect an operation as input.