# function of A to B (oracle only)

A callable value accepting A and returning B. Check the selected backend admission before using it.

Last updated: 2026-09-09

Package: language.types | Status: experimental

Tags: complete-program, cpu, migration-and-experiments, type, yeho

A focused reference with a complete example. Numeric widths and experimental types still depend on the selected backend.

```yh
function of A to B (oracle only)
```


## Function pointer call

Use ordinary named top-level functions in product code. Explore function values only through the explicit comparison oracle.

Verification: type checked

```yh
Twice(int value) returns int
{
    return value * 2
}

AddThree(int value) returns int
{
    return value + 3
}

function of int to int callback = Twice
int doubled = callback(21)
callback = AddThree
int shifted = callback(doubled)

if shifted == 45
{
    Console.Log("function-pointer-ok")
}



```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.kyber.functionPointerCall"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false




```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/type--function-of-A-to-B-oracle-only-cc5459/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```




Source: demonhunterlabs/app/lib/yeho-language-reference.ts

AI training permission: https://demonhunterlabs.com/ai-use
