From 5aa0cdc38d054c86210d575fa60b783524b135ff Mon Sep 17 00:00:00 2001 From: George Thomas Date: Fri, 20 Feb 2026 09:09:12 +0000 Subject: [PATCH] try using record dots with TH --- cabal.project | 6 +++--- lib/GarnetRs/Raw.hs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index 52115f5..c29c71b 100644 --- a/cabal.project +++ b/cabal.project @@ -5,10 +5,10 @@ packages: . -- so we specify the equivalent commit SHAs manually instead source-repository-package type: git - location: https://github.com/well-typed/hs-bindgen - tag: e2a9260678d9fa76dab602a5a07927acada3be4f + location: https://github.com/georgefst/hs-bindgen + tag: 3693360bcd1f8478932c4944c70baca7c4ecf950 subdir: c-expr-dsl c-expr-runtime hs-bindgen hs-bindgen-runtime - --sha256: 0nrs3iq0l5ha5kxyhqnlmvgi7734pmzyp3zf7p8s1gb21ylh4sy0 + --sha256: lV2FwS80iHhJU6iie/F24W4dYV+vvmeTu6465NLnOb4= source-repository-package type: git location: https://github.com/well-typed/libclang diff --git a/lib/GarnetRs/Raw.hs b/lib/GarnetRs/Raw.hs index c1344f1..8ec2e16 100644 --- a/lib/GarnetRs/Raw.hs +++ b/lib/GarnetRs/Raw.hs @@ -1,6 +1,7 @@ {-# LANGUAGE CApiFFI #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FieldSelectors #-} +-- {-# LANGUAGE NoFieldSelectors #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TemplateHaskell #-} @@ -41,6 +42,9 @@ do withHsBindgen def { clang = def{extraIncludeDirs = Pkg "rust" : systemDirs} + -- hmm, I guess there's a reason this wasn't exported + -- , fieldNamingStrategy = EnableRecordDot + , fieldNamingStrategy = PrefixedFieldNames } def $ hashInclude "garnet_rs.h"