aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-09 12:12:30 +0200
committerTom Smeding <tom@tomsmeding.com>2024-06-09 12:12:30 +0200
commit122f8fa9e5f8dc8a7bc431957b48363179853824 (patch)
treea1cda2a6bee951059870f9c91968ad0303038038
Initial
-rw-r--r--.gitignore1
-rw-r--r--cabal.project2
-rw-r--r--cbits/arith.c1
-rw-r--r--repro.cabal18
-rw-r--r--src/A.hs9
-rw-r--r--src/B.hs8
-rw-r--r--src/F.hs5
7 files changed, 44 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c33954f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+dist-newstyle/
diff --git a/cabal.project b/cabal.project
new file mode 100644
index 0000000..25dd1f1
--- /dev/null
+++ b/cabal.project
@@ -0,0 +1,2 @@
+packages: .
+with-compiler: ghc-9.8.2
diff --git a/cbits/arith.c b/cbits/arith.c
new file mode 100644
index 0000000..f1faa51
--- /dev/null
+++ b/cbits/arith.c
@@ -0,0 +1 @@
+void some_c_function(void) {}
diff --git a/repro.cabal b/repro.cabal
new file mode 100644
index 0000000..3a22448
--- /dev/null
+++ b/repro.cabal
@@ -0,0 +1,18 @@
+cabal-version: 3.0
+name: repro
+version: 0.1.0.0
+author: Tom Smeding
+license: BSD-3-Clause
+build-type: Simple
+
+library
+ exposed-modules: F A B
+ build-depends: base, template-haskell,
+ hs-source-dirs: src
+ c-sources: cbits/arith.c
+
+ cc-options: -O3 -Wall -Wextra -std=c99
+
+ default-language: Haskell2010
+ ghc-options: -Wall
+ other-extensions: TemplateHaskell
diff --git a/src/A.hs b/src/A.hs
new file mode 100644
index 0000000..3b994e1
--- /dev/null
+++ b/src/A.hs
@@ -0,0 +1,9 @@
+module A where
+
+import Language.Haskell.TH
+
+import F
+
+
+kaas :: Exp
+kaas = LitE (StringL "kaas")
diff --git a/src/B.hs b/src/B.hs
new file mode 100644
index 0000000..1b88325
--- /dev/null
+++ b/src/B.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+module B where
+
+import A
+
+
+-- $([d| foo = $(LitE . StringL . show . isRelevant <$> [t| Ranked 4 Double |]) |])
+$([d| foo = $(return $ kaas) |])
diff --git a/src/F.hs b/src/F.hs
new file mode 100644
index 0000000..911a3db
--- /dev/null
+++ b/src/F.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+module F where
+
+
+foreign import ccall "some_c_function" c_some_c_function :: IO ()