about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/examples/rts/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/bazel/rules_haskell/examples/rts/main.c')
-rw-r--r--third_party/bazel/rules_haskell/examples/rts/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/third_party/bazel/rules_haskell/examples/rts/main.c b/third_party/bazel/rules_haskell/examples/rts/main.c
new file mode 100644
index 000000000000..28624227d8c0
--- /dev/null
+++ b/third_party/bazel/rules_haskell/examples/rts/main.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include "HsFFI.h"
+
+extern HsInt add_one_hs(HsInt a0);
+
+int main(int argc, char *argv[]) {
+  hs_init(&argc, &argv);
+  printf("Adding one to 5 through Haskell is %ld\n", add_one_hs(5));
+  hs_exit();
+  return 0;
+}