Re:Learn You an Agda
by nitrogen on Wednesday December 03, 2014 @07:33PM
(#8697238)
Thanks for the very straightforward explanation of how strongly typed functional programs can have effects in the real world.
(forgive mistakes; I've never used function pointers in C)
You mostly got it right; the function declaration would look like this (I moved the * for pointers onto the parameter name for stylistic reasons related to how C declares types):
void main(op *instruction, int *length, void (*callback)(...))
Also, your function pointer calls should omit the * in front (it would be applied to the return value of the callback, which is void in this case, so you'd get an error during compilation).
(forgive mistakes; I've never used function pointers in C)
You mostly got it right; the function declaration would look like this (I moved the * for pointers onto the parameter name for stylistic reasons related to how C declares types):
Also, your function pointer calls should omit the * in front (it would be applied to the return value of the callback, which is void in this case, so you'd get an error during compilation).