CurriedOpC 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.Canon

Package: Microsoft.Quantum.Standard

Returns a curried version of an operation on two inputs.

function CurriedOpC<'T, 'U> (op : (('T, 'U) => Unit is Ctl)) : ('T -> ('U => Unit is Ctl))

Description

Given an operation with two inputs, this function applies Curry's isomorphism $f(x, y) \equiv f(x)(y)$ to return an operation of one input which returns an operation of one input.

Input

op : ('T,'U) => Unit is Ctl

An operation whose input is a pair.

Output : 'T -> 'U => Unit is Ctl

An operation which accepts the first element of a pair and returns an operation which accepts as its input the second element of the original operation's input.

Type Parameters

'T

The type of the first component of a function defined on pairs.

'U

The type of the second component of a function defined on pairs.

Remarks

The following are equivalent:

op(x, y);

let curried = CurriedOp(op);
let partial = curried(x);
partial(y);

See Also