From 81133a71bc4240b03c3a1cf712797765ec41679d Mon Sep 17 00:00:00 2001 From: John Soo Date: Sun, 7 Jul 2019 17:40:12 -0700 Subject: [PATCH 06/12] gnu: Add ghc-storable-record. * gnu/packages/haskell.scm (ghc-storable-record): New variable. --- gnu/packages/haskell.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 6188e477e2..6638868ab9 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -2782,6 +2782,38 @@ might have favorable performance characteristics as well. These wild claims are still completely unverified though.") (license license:bsd-3))) +(define-public ghc-storable-record + (package + (name "ghc-storable-record") + (version "0.0.4") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://hackage.haskell.org/package/storable-record/storable-record-" + version ".tar.gz")) + (sha256 + (base32 + "0hjs1km0fc9ch0i1rbycxia5w3939hk4p4md73ikgg4aipqb5zyf")))) + (build-system haskell-build-system) + (inputs + `(("ghc-semigroups" ,ghc-semigroups) + ("ghc-utility-ht" ,ghc-utility-ht) + ("ghc-storablevector" ,ghc-storablevector) + ("ghc-timeit" ,ghc-timeit))) + (home-page "https://hackage.haskell.org/package/storable-record") + (synopsis "Elegant definition of Storable instances for records") + (description + "With this package you can build a Storable instance of a record type +from Storable instances of its elements in an elegant way. It does not do any +magic, just a bit arithmetic to compute the right offsets, that would be +otherwise done manually or by a preprocessor like C2HS. I cannot promise that +the generated memory layout is compatible with that of a corresponding C +struct. However, the module generates the smallest layout that is possible +with respect to the alignment of the record elements.") + (license license:bsd-3))) + (define-public ghc-storablevector (package (name "ghc-storablevector") -- 2.22.0