mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
14 lines
272 B
Idris
14 lines
272 B
Idris
import System.FFI
|
|
|
|
PtrAST : Type
|
|
PtrAST = Struct "AST" [("value", AnyPtr)]
|
|
|
|
%foreign "C:freeAST,foo"
|
|
prim_freeAST : (PtrAST -> Int) -> PrimIO ()
|
|
|
|
freeAST : HasIO io => (PtrAST -> Int) -> io ()
|
|
freeAST ast = primIO $ prim_freeAST ast
|
|
|
|
main : IO ()
|
|
main = freeAST (\x => 1)
|