aboutsummaryrefslogtreecommitdiff
path: root/ox-arrays.cabal
diff options
context:
space:
mode:
Diffstat (limited to 'ox-arrays.cabal')
-rw-r--r--ox-arrays.cabal110
1 files changed, 75 insertions, 35 deletions
diff --git a/ox-arrays.cabal b/ox-arrays.cabal
index 39a2782..3a92f6e 100644
--- a/ox-arrays.cabal
+++ b/ox-arrays.cabal
@@ -1,10 +1,23 @@
cabal-version: 3.0
name: ox-arrays
version: 0.1.0.0
-author: Tom Smeding
+synopsis: An efficient CPU-based multidimensional array (tensor) library
+description:
+ An efficient and richly typed CPU-based multidimensional array (tensor)
+ library built upon the optimized tensor representation (strides list)
+ implemented in the orthotope package. See the README.
+
+ If you use this package: let me know (e.g. via email) if you find it useful!
+ Both positive feedback (keep this!) and negative feedback (I needed this but
+ ox-arrays doesn't provide it) is welcome.
+copyright: (c) 2025 Tom Smeding, Mikolaj Konarski
+author: Tom Smeding, Mikolaj Konarski
+maintainer: Tom Smeding <xhackage@tomsmeding.com>
license: BSD-3-Clause
+category: Array, Tensors
build-type: Simple
+extra-doc-files: README.md CHANGELOG.md
extra-source-files: cbits/arith_lists.h
flag trace-wrappers
@@ -12,7 +25,7 @@ flag trace-wrappers
Compile modules that define wrappers around the array methods that trace
their arguments and results. This is conditional on a flag because these
modules make documentation generation fail.
- (https://gitlab.haskell.org/ghc/ghc/-/issues/24964 , should be fixed in
+ (@https://gitlab.haskell.org/ghc/ghc/-/issues/24964@ , should be fixed in
GHC 9.12)
default: False
manual: True
@@ -34,44 +47,70 @@ flag pedantic-c-warnings
default: False
manual: True
+flag default-show-instances
+ description:
+ Use default GHC-derived Show instances for arrays, shapes and indices. This
+ exposes the internal struct-of-arrays representation and is less readable,
+ but can be useful for ox-arrays debugging.
+ default: False
+ manual: True
+
+common basics
+ default-language: Haskell2010
+ ghc-options: -Wall -Wcompat -Widentities -Wunused-packages
+
library
+ import: basics
exposed-modules:
- Data.Array.Mixed.Internal.Arith
- Data.Array.Mixed.Lemmas
- Data.Array.Mixed.Permutation
- Data.Array.Mixed.Shape
- Data.Array.Mixed.Types
- Data.Array.Mixed.XArray
+ -- put this module on top so ghci considers it the "main" module
Data.Array.Nested
- Data.Array.Nested.Internal.Convert
- Data.Array.Nested.Internal.Mixed
- Data.Array.Nested.Internal.Lemmas
- Data.Array.Nested.Internal.Ranked
- Data.Array.Nested.Internal.Shape
- Data.Array.Nested.Internal.Shaped
+
+ Data.Array.Nested.Convert
+ Data.Array.Nested.Mixed
+ Data.Array.Nested.Mixed.Shape
+ Data.Array.Nested.Mixed.Shape.Internal
+ Data.Array.Nested.Lemmas
+ Data.Array.Nested.Permutation
+ Data.Array.Nested.Ranked
+ Data.Array.Nested.Ranked.Base
+ Data.Array.Nested.Ranked.Shape
+ Data.Array.Nested.Shaped
+ Data.Array.Nested.Shaped.Base
+ Data.Array.Nested.Shaped.Shape
+ Data.Array.Nested.Types
+ Data.Array.Strided.Orthotope
+ Data.Array.XArray
+ Data.Bag
+ Data.Vector.Generic.Checked
+
+ if impl(ghc < 9.8)
+ exposed-modules:
+ GHC.TypeLits.Orphans
if flag(trace-wrappers)
exposed-modules:
Data.Array.Nested.Trace
Data.Array.Nested.Trace.TH
+ if flag(default-show-instances)
+ cpp-options: -DOXAR_DEFAULT_SHOW_INSTANCES
+
build-depends:
strided-array-ops,
- base >=4.18 && <4.21,
- deepseq,
+ base,
+ deepseq < 1.7,
ghc-typelits-knownnat,
ghc-typelits-natnormalise,
- orthotope,
+ orthotope < 0.2,
template-haskell,
- vector
+ vector,
+ vector-stream
hs-source-dirs: src
-
- default-language: Haskell2010
- ghc-options: -Wall
other-extensions: TemplateHaskell
library strided-array-ops
+ import: basics
exposed-modules:
Data.Array.Strided
Data.Array.Strided.Array
@@ -81,11 +120,13 @@ library strided-array-ops
Data.Array.Strided.Arith.Internal.Lists
Data.Array.Strided.Arith.Internal.Lists.TH
build-depends:
- base,
- ghc-typelits-knownnat,
- ghc-typelits-natnormalise,
- template-haskell,
- vector
+ base >=4.18 && <4.23,
+ ghc-typelits-knownnat >= 0.8.0 && < 1
+ -- 0.9.0 is unsound: https://github.com/clash-lang/ghc-typelits-natnormalise/issues/105
+ && (< 0.9.0 || > 0.9.0),
+ ghc-typelits-natnormalise >= 0.8.1 && < 1,
+ template-haskell < 3,
+ vector < 0.14
hs-source-dirs: ops
c-sources: cbits/arith.c
@@ -98,11 +139,10 @@ library strided-array-ops
-- hmatrix assumes sse2, so we can too
cc-options: -msse2
- default-language: Haskell2010
- ghc-options: -Wall
other-extensions: TemplateHaskell
test-suite test
+ import: basics
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
@@ -118,25 +158,23 @@ test-suite test
ghc-typelits-natnormalise,
hedgehog,
orthotope,
- random,
+ random >= 1.3.0,
tasty,
tasty-hedgehog,
vector
hs-source-dirs: test
- default-language: Haskell2010
- ghc-options: -Wall
test-suite example
+ import: basics
type: exitcode-stdio-1.0
main-is: Main.hs
build-depends:
ox-arrays,
base
hs-source-dirs: example
- default-language: Haskell2010
- ghc-options: -Wall
benchmark bench
+ import: basics
type: exitcode-stdio-1.0
main-is: Main.hs
build-depends:
@@ -148,5 +186,7 @@ benchmark bench
tasty-bench,
vector
hs-source-dirs: bench
- default-language: Haskell2010
- ghc-options: -Wall
+
+source-repository head
+ type: git
+ location: https://git.tomsmeding.com/ox-arrays