mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-03 00:36:37 +03:00
a972778eab
They don't all pass yet, for minor reasons. Coming shortly... Unfortunately the startup overhead for chez is really noticeable here!
24 lines
379 B
C
24 lines
379 B
C
#include <stdio.h>
|
|
|
|
typedef int(*IntFn)(int, int);
|
|
typedef char(*CharFn)(char, int);
|
|
|
|
int add(int x, int y) {
|
|
return x+y;
|
|
}
|
|
|
|
int applyIntFn(int x, int y, IntFn f) {
|
|
printf("Callback coming\n");
|
|
fflush(stdout);
|
|
return f(x, y);
|
|
}
|
|
|
|
int applyIntFnPure(int x, int y, IntFn f) {
|
|
return f(x, y);
|
|
}
|
|
|
|
char applyCharFn(char c, int x, CharFn f) {
|
|
return f(c, x);
|
|
}
|
|
|