Changelog History
-
v0.8.0.0 Changes
June 11, 2026[π₯]0.8.0.0π Version 0.8 significantly expands the API with new BLAS, LAPACK, and Algorithm functions including
gemm,eigSH,pinverse, and nine segmented by-key reductions, along with ergonomic indexing via the(!)and(.~)infix operators. Scalar-returning functions (meanAll,varAll,stdevAll,corrCoef,det, etc.) now return a preciseScalar atype via the newAFResulttypeclass rather than an untyped(Double, Double)pair, and several other return types have been corrected throughout (CBoolfor boolean ops,Word32for index arrays,Complex afor complex construction). A number of long-standing bugs are fixed:signumfor unsigned types and IEEE 754 negative zero, a double-free ingetDefaultRandomEngine, uninitialized FFI output slots (replaced by zero-initcalloca), and incorrectEqbehaviour for arrays with mismatched shapes. Test coverage has been substantially expanded with property-based tests for BLAS/LAPACK algebraic laws, MooreβPenrose conditions, eigendecomposition correctness, semiring/ring laws viaQuickCheck.Classes, exception FFI propagation, and a completeIndexSpec. On the build side, the Nix flake gains CUDA and darwin (x86_64 via Rosetta 2) support, and CI now usesners/simply-nixwith automatic Haddock deployment to GitHub Pages.BLAS
gemmβ general matrix multiply (Ξ±Β·op(A)Β·op(B) + Ξ²Β·C) with scalar scaling and in-place accumulation
LAPACK
eigSHβ symmetric/Hermitian eigendecomposition (cuSOLVER on CUDA, Jacobi fallback on CPU/OpenCL)pinverseβ MooreβPenrose pseudoinverse
Algorithm
sumByKey,sumByKeyNaN,productByKey,productByKeyNaN,minByKey,maxByKey,allTrueByKey,anyTrueByKey,countByKeyβ segmented (key-value) reductions
Statistics
meanVar,meanVarWeightedβ mean and variance in a single passvarAll/varAllWeightednow takeVarianceTypeinstead ofBool
Data / Array
fromVectorβ zero-copyStorable Vector β ArrayingestionbitNotβ bitwise complementevalβ explicitly flush the ArrayFire JIT queuedeviceGCβ trigger device-side garbage collection (af_device_gc)inverseDeconvβ inverse deconvolution (Image module)
Index
assignSeqβ write a source array into a sequential slice of a destinationindexGenβ generalised indexing by a list ofIndexvaluesassignGenβ generalised slice assignment(!)β infix indexing operator (arr ! at 0,arr ! range 1 3,arr ! (range 0 2, at 1));infixl 9- π
(.~)β infix lens-style slice assignment (arr & range 1 3 .~ src);infixr 4 spanrenamed toafSpan(avoids shadowingPrelude.span)
π₯ Breaking / type changes
meanAll,meanAllWeighted,varAll,varAllWeighted,stdevAll,medianAll,corrCoef,detβ returnScalar a(via newAFResulttypeclass) instead of(Double, Double)sort,sortIndex,sortByKeyβ takeOrder(Asc | Desc) instead ofBoolimin,imax,sortIndex,topkβ index output corrected toArray Word32(wasArray a)isZero,isInf,isNaN,allTrue,anyTrueβ returnArray CBool(wasArray a)where'β returnsArray Word32(wasArray a)cplx,cplx2,cplx2Batchedβ returnArray (Complex a)(wasArray a)real,imagβ signature tightened toArray (Complex a) -> Array abitAnd,bitOr,bitXor,bitShiftL,bitShiftRβ returnArray a(wasArray CBool)- π
gemmβbetaparameter removed (was silently a no-op; zero-filled internally) countByKey/allTrueByKey/anyTrueByKeyβ output value type corrected toWord32/CBool- π
Indextype β phantom type parameter removed; simpler unparameterised sum type
π Bug fixes
- π
signumβ fixed for unsigned types (was wrapping vianegate) and IEEE 754 negative zero; now usescast(gt x 0) - cast(lt x 0) afBackendCpuβ was incorrectly bound toAF_BACKEND_DEFAULTtoConnectivityβAFConnectivity 8was mapped toConn4instead ofConn8- π
histogramβ removed spurious double-cast aroundaf_histogram getDefaultRandomEngineβ fixed double-free (missingaf_retain_random_enginebefore finalizer)Eq (Array a)β checks dimensions first beforeallTrueAll(broadcast was producing wrong results for mismatched shapes)- FFI output slots β all
allocaoutput pointers zero-initialised viacalloca(was reading uninitialised stack for real-valued arrays) piβ usesrealToFrac (Prelude.pi :: Double)instead of a truncated literal
FFI / internals
AFResulttypeclass with associatedScalar atype family: real/integral instances yieldDouble, complex instances yieldComplex Double; used to give scalar-returning functions (meanAll,varAll,stdevAll,medianAll,corrCoef,det, etc.) precise return types instead of the untyped(Double, Double)pair- π
callocaadded β zero-initialised stack allocation replacing the oldzeroOutArrayC helper (which is removed) - All
op*helpers inFFI.hsnow wrapunsafePerformIOwithmask_to prevent segfaults from async exceptions during FFI calls op1generalised toArray a -> β¦ -> Array b(removing the redundantop1d)op2pgeneralised to(Array a, Array b)(was(Array a, Array a))- π New
op2p2kvhelper for key-value two-output FFI calling convention - 0οΈβ£
VarBiastype introduced (VarianceDefault | VarianceSample | VariancePopulation) backed byAFVarBiasinInternal/Defines.hsc
β Tests
- Comprehensive
IndexSpeccoveringindex,afSpan,lookup,assignSeq,indexGen,assignGen,(!),(.~),rangeStep, and indexing round-trip properties AlgorithmSpec: all*ByKeysegmented reduction functionsBLASSpec:gemm(identity, alpha-scaling, transpose); matmul/transpose/dot algebraic propertiesLAPACKSpec: QR/SVD/Cholesky reconstruction;eigSHeigenvalue ordering, eigenvector orthonormality, matrix reconstruction;pinverseMooreβPenrose conditionsStatisticsSpec:meanVar(population and sample);meanVarWeightedNumericalSpec: power-iteration eigenvalue convergenceArithSpec/ArraySpec:bitNot,cplx/real/imaground-trips,signumfor unsigned and float-zero edge casesExceptionSpec:AFExceptionFFI boundary propagation;toAFExceptionTypefor all documentedAFErrcodes- π Random: fixed-seed reproducibility, distinct-seed divergence, distribution shape/range
- β
Semiring/Ring laws via
QuickCheck.Classesfor scalar and array instances; test suite fails iflawsCheckfails
π CI / build
- π Nix flake: CUDA backend support (
cudatoolkit,nvidia_x11,allowUnfree) - π Nix flake: darwin (x86_64 via Rosetta 2) build and
devShellsupport - CI: switched from
cachix/install-nix-actiontoners/simply-nix@mainwithreclaim_space: true - π CI: Haddock docs published to GitHub Pages on push to
master - Switched from
hspectohspec-discover
What's Changed
- β Add nix build to CI by @dmjio in #67
- β Add darwin build and dev support. by @dmjio in #69
- π Expand API: BLAS, reductions, statistics, index ops, bitwise; type & FFI fixes by @dmjio in #68
Full Changelog : 0.7.1.0...0.8.0.0
-
v0.7.1.0 Changes
May 27, 2026What's Changed
- π Fix tests for ArrayFire 3.8.3 by @twesterhout in #51
- β Switch to Nix flakes; make the tests pass with newest ArrayFire by @twesterhout in #55
- π Fix joinMany by @twesterhout in #56
- Fix (**) and use property tests for Floating by @twesterhout in #57
- β Relax some tests that are satisfied only up to some floating point error. by @leftaroundabout in #59
- Export the special
spanvalue for not-indexing an array dimension. by @leftaroundabout in #61 - Correct
signumfunction according to the Haskell report. by @leftaroundabout in #60 - Adjust lookup function to use
Intindices by @dmjio in #63 - β Add CI. Generalize
op2type parameter. by @dmjio in #64
π New Contributors
- @leftaroundabout made their first contribution in #59
Full Changelog : 0.7.0.0...0.7.1.0
-
v0.7.0.0 Changes
October 02, 2022- β
Use latest GHC (
9.2.2/9.4.2) - β
Use latest arrayfire (
3.8.2) - π Fix tests for
productandvariancefunctions - β‘οΈ Update various scripts (
nix,.ghci, etc.)
π¦ Hackage Link
- β
Use latest GHC (
-
v0.6.0.0 Changes
November 15, 2019- π Documentation fix for
negate - π Change public interface on
BLASfunctions to constrain onAFType - Adjust cabal file, account for different environments correctly
- π Documentation fix for
-
v0.5.1.0 Changes
November 12, 2019- π Updated documentation for column-major order
- π Bugfix of double free
- β Add hackage docs upload scripts
-
v0.5.0.0 Changes
November 09, 2019- β Add strong types for logical operators (
CBool) - Adjust smart constructors to work column-major oriented.
- π Light doc fixes.
- β Add strong types for logical operators (
-
v0.4.0.0 Changes
November 06, 2019- β Removed
Ordinstance sincecomparewas ambiguous. - 0οΈβ£ Show Array transposed by default.
- β Removed
-
v0.3.0.0 Changes
November 06, 2019- β‘οΈ Update
Eq/Ordto operate element-wise alongArray.
- β‘οΈ Update
-
v0.2.0.0 Changes
November 06, 2019- β‘οΈ Updated external interface for
realandimag - β Removed functions that are not present in the
3.6.4API (af_pinverse, etc.) - Adjust cabal flags
- β‘οΈ Updated external interface for
-
v0.1.0.0 Changes
November 06, 2019π π Initial Alpha Release π
- Based on 3.6.4 version of the API.