massiv
Massiv (Массив) is an Array Library.
https://github.com/lehins/massiv
| Version on this page: | 0.6.0.0 | 
| LTS Haskell 24.17: | 1.0.5.0 | 
| Stackage Nightly 2025-10-31: | 1.0.5.0 | 
| Latest on Hackage: | 1.0.5.0 | 
BSD-3-Clause licensed by Alexey Kuleshevich
Maintained by [email protected]
This version can be pinned in stack with:
massiv-0.6.0.0@sha256:a4cad5722d50f34ae8e8a75d3f80402e194ef269f4444ec03fd870b2cbecdb0a,4664Module documentation for 0.6.0.0
- Data- Data.Massiv- Data.Massiv.Array
- Data.Massiv.Core
- Data.Massiv.Vector
- Data.Massiv.Vector.Stream
 
 
 
- Data.Massiv
Depends on 8 packages(full list with versions):
Used by 4 packages in nightly-2021-02-25(full list with versions):
Changes
0.6.0
- Fix semantics of Applicative,NumandFractionalinstance forDarrays: mismatched sizes will throw an error.
- 20% speed improvement of matrix multiplication: multiplyMatrices,.><.and!><!. Type signature has changed toMutablefor both arguments, thus it’s a breaking change.
- Switch ><.and><!from returning a delayed array to mutable, since that’s whatmultiplyVectorByMatrixreturns.
- Addition of synonym HighIxNand removing redundant1 <= nconstraint.
- Deprecating makeStencilDef,unsafeMapStenciland fix dangers of invalid stencils reading out of bounds. Get rid ofValue. Fix for #109.
- Addition of appComp
- Addition of mkSzM
- Addition of SizeOverflowExceptionandSizeNegativeException
- Fix setting computation for boxed vector when converted with fromVectorMandfromVector'
- Add computation strategy argument to fromUnboxedVector, just so it matches other vector conversion functions.
- Removed defaultElement
- Removed deprecated functions: #>,|*|,multiplyTransposed,fromIntegerA,fromRationalA,piA
- Addition of BLrepresentation and related functionality, fix for #111.- Addition of functions: wrapLazyArray,unwrapLazyArray,toLazyArray,evalLazyArray,forceLazyArray,unwrapMutableLazyArray,fromBoxedVector,fromBoxedMVector.
- Rename:
- unsafeNormalBoxedArray->- coerceNormalBoxedArray
- unsafeBoxedArray->- coerceBoxedArray
 
- Remove unsafeFromBoxedVector
- Conversion from vector with castFromVectorwill returnBLrepresentation for boxed vector
- Change type B->BLfor functions:toBoxedVectorandtoBoxedMVector
 
- Addition of functions: 
- Rename N->BNand add backwards compatibility shim.
- Make replicatea function inConstructclass
- Add newMArray,newMArray'and deprecatenew
- Add custom implementation for <$inFunctorinstances forBLandB.
0.5.9
- Add mallocCompute,mallocCopyandunsafeMallocMArray
- Fix .><.,><.and.><on empty matrices. Result is now guaranteed to be empty too.
- Add unwrapByteArrayOffsetandunwrapMutableByteArrayOffset
- Add fromByteArrayOffsetMandfromMutableByteArrayOffsetM
0.5.8
- Improve loading of push arrays by adding loadArrayWithSetMand deprecatingdefaultElement.
0.5.7
- Improve performance of ><.and><!while making their constraints a bit more relaxed.
- Expose unsafeLoadIntoMandunsafeLoadIntoS
- Expose eqArraysandcompareArrays
- Add multiplyMatrixByVectorandmultiplyVectorByMatrix
0.5.6
- Fix (-.)(it was incorrectly implemented as a flip of(.-)
- Addition of numeric functions:
- Partial: !+!,!-!,!*!,!/!
- Reciprocal division /.
- More efficient matrix-matrix multiplication: .><.and!><!(also helpersmultiplyMatricesandmultiplyMatricesTransposed)
- More efficient matrix-vector multiplication: .><and!><
- New vector-matrix multiplication: ><.and><!
- Dot product dotMand!.!
- Norm normL2
 
- Partial: 
- Deprecated |*|and#>
0.5.5
- Add takeWhile,dropWhileandfindIndex
- Improve performance of any,and,or,all
- Add elem
0.5.4
- Addition of unsafeTransformStencil
- Add zip4,unzip4,zipWith4andizipWith4
- Make Resizea superclass ofSource
- Addition of outerSlices,innerSlices,withinSlicesandwithinSlicesM
- Addition of stackSlicesM,stackOuterSlicesMandstackInnerSlicesM
- Addition of computeP
- Fix perfomrmance issue of folding functions applied to arrays with Seqcomputation strategy.
0.5.3
- Fix tanAandtanhA. #96
- Relax argument of snocandconsconstraint toLoadvectors
- Improve unsnocMandunconsMby switching tounsafeLinearSlice, instead of delaying the array.
- Fix parallelization for windowed array when computed with stride
- Fix massiv doctests not being able to find massiv.h under NixOS
0.5.2
- Addition of lowerTriangularandupperTriangular
- Relax identityMatrixtype to return an array of anyNumtype, not justInt.
- Addition of unsafeMakeLoadArrayAdjusted
- Add matrix-vector product ((#>))
- Addition of siterate
0.5.1
- Fix sfromListNaccepting a plainIntinstead ofSz1, as well as switch to upper bound.
- Fix order of argumetns in iforM
- Restrict szip*,szipWith*andsizipWith*functions to flat vectors.
- Addition of unsafeSUnfoldrN,unsafeSUnfoldrNMandunsafeSFromListN
- Fix sunfoldrN,sunfoldrNMandsfromListNto not trust the supplied size.
- Move isEmptyintoLoadclass
- Add isNotEmpty
0.5.0
- Remove Showinstance fromValue.
- Addition of unsafeCreateArray,unsafeCreateArray_andunsafeCreateArrayS
- Remove Compargument from functions that ignore it and set it toSeq:- createArrayS_,- createArrayS,- createArrayST_,- createArrayST
- unfoldrPrimM_,- iunfoldrPrimM_,- unfoldrPrimM,- iunfoldrPrimM
- unfoldlPrimM_,- iunfoldlPrimM_,- unfoldlPrimM,- iunfoldlPrimM
 
- Addition of fromStorableVectorandfromStorableMVector
- Modify toMutableByteArrayto produce a copy if dealing with slice.
- Addition of toByteArrayM,toMutableByteArrayM
- Change replicateto produce delayed load arrayDL
- Export unsafe stencil functions from Data.Array.Massiv.Unsafe, rather than fromData.Massiv.Array.Stencil.Unsafe.
- Implement unsafeMapStenciland deprecatemapStencilUnsafeandforStencilUnsafe
- Addition of castToBuilder
- Addition of conversion functions:
- unwrapNormalFormand- evalNormalForm
- toBoxedVector,- toBoxedMVector,- evalBoxedVectorand- evalBoxedMVector
- unwrapByteArrayand- unwrapMutableByteArray
- toPrimitiveVector,- toPrimitiveMVector,- fromPrimitiveVectorand- fromPrimitiveMVector
- toStorableVector,- toStorableMVector,- fromStorableVectorand- fromStorableMVector
- fromUnboxedVectorand- fromUnboxedMVector
- unsafeBoxedArray,- unsafeNormalBoxedArray,- unsafeFromBoxedVector
 
- Removed deprecated traverseAR,itraverseAR,traversePrimRanditraversePrimR
- Removed: imapMR,imapMR,iforMR, andiforMR
- Renamed:
- withMArrayto- withMArray_,
- withMArraySto- withMArrayS_and
- withMArraySTto- withMArrayST_
 
- Added versions that keep the artifact of mutable action: withMArray,withMArrayS,withMArrayST.
0.4.5
- Addition of computeIOandcomputePrimM
- Addition of makeArrayLinearA
- Addition of traverseS
- Fix regression in performance introduced in massiv-0.4.0
0.4.4
- Addition of appendOuterMandconcatOuterM
- Addition of zoom
- Addition of write_,modify_andswap_
0.4.3
- Addition of catMaybesSandtally
0.4.3
- Addition of applyStencilandPaddingwith helper functionsnoPaddingandsamePadding.
- Addition of foldlStencil,foldrStenciland monoidalfoldStencil.
- Addition of common generic stencils: sumStencil,productStencil,avgStencil,maxStencil,minStencilandidStencil.
- Addition of mapStencilUnsafefor the brave.
- Improve compile time error reporting for invalid dimensions.
- Fix incorrect loading of DWarrays of dimension higher than 3
- Addition of foldOuterSlice,ifoldOuterSlice,foldInnerSliceandifoldInnerSlice. Fix for #56
0.4.2
- Fix loading empty DSstream arrays of unknown size. Fix for #83.
0.4.1
- Introduction of StreamandDSrepresentation:- filterS,- filterM,- ifilterS,- ifilterM
- mapMaybeS,- mapMaybeM,- imapMaybeS,- imapMaybeM
- unfoldr,- unfoldrN
- takeSand- dropS
 
- Deprecated traverseAR,itraverseAR,traversePrimR,itraversePrimR(not feasible to keep duplicate functions just for representation,TypeApplicationsorScopedVariablesshould be used instead.)
- Fix performance issue with copying of unboxed arrays and initialization of storable array.
- Addition of unsafeLoadIntoS,unsafeLoadIntoandmaxSize
- Addition of reverse,reverse'andreverseM
- Addition of modifyDimension,modifyDimM, andmodifyDim'
0.4.0
- Made Constructa super class ofMutable
- Reimplement a safe version of makeLoadArray, that is parallelizable.
- Switch from EltRepr r ixto much simplerR r
- Remove Constructinstance forMrepresentation.
- unsafeLinearSet- length argument now accepts- Sz1instead of an- Int
- Renamed:
- forPrimM_->- forPrimM
- iforPrimM_->- iforPrimM
- iforLinearPrimM_->- iforLinearPrimM
 
- Introduced new functions that do not mutate the original array: forPrimM_,iforPrimM_andiforLinearPrimM_
- Addition of readM,writeM,modifyM,swapM,modifyM_,swapM_
- Add an orphan instance of MonadThrowforSTmonad for older versions ofexceptions. See ekmett/exceptions#72
- Deprecation of read',write'modify'andswap'
- Make modifyaccept a monadic action, rather than a pure function. Also now it returns the old element.
- Make swapreturn the swapped elements.
- Addition of unsafeLinearSwapandunsafeSwap
- Expose unsafeLinearModifyandunsafeModify
- Expose Data.Massiv.Core.List
- Expose indexWith, so macroINDEX_CHECKfrommassiv.hcould be used outside massiv.
- Addition of liftSz
- Fixed expand*functions by making them acceptSz1instead of anInt
- Addition of expandWithinM
- Bunch of minor fixes to Showinstances
- Extracted test-suite into it’s own package.
- Stop accepting computation strategy for all functions that can be performed sequentially only:
- iterateN
- iiterateN
- unfoldrS_
- iunfoldrS_
- unfoldlS_
- iunfoldlS_
- makeArrayA
- makeArrayAR
- generateArrayLinearS
- generateArrayS
 
- Redefined most of the numeric operators with NumericandNumericFloat. Will be required for SIMD operations.
- Num,- Fractionaland- Applicativefor- Dchanged behavior: instead of treating singleton as a special array of any size it is treated as singleton.
0.3.6
- Addition of unsafeArrayLinearCopy,unsafeLinearCopy,unsafeLinearShrink,unsafeLinearGrow
- Implementation of iterateUntilanditerateUntilM
- identityMatrix- generation of identity matrix
0.3.5
- Fix and export guardNumberOfElements
- Eqinstances for- IndexExceptionand- SizeException
- Fix upsampleimplementation and improve its performance.
- Addition of deleteRegionM,deleteRowsManddeleteColumnsM
0.3.4
- Use the the new stateful workers feature of scheduler-1.4.0
- Addition of:
- randomArrayS
- randomArrayWS
- generateArrayWS
- generateArrayLinearWS
- mapWS,- forWS,- imapWSand- iforWS
- and splitLinearlyWithStatefulM_
 
0.3.3
- Fix type signature for createArray.
- Support for new version of scheduler
- Addition of randomArray
0.3.2.1
- Fix sqrtAfunction: #76
0.3.2
- Exported withMArrayS
- Switch to pure exception throwing for read',write',modify'andswap'.MonadThrowconstraint prevented those functions to be used inSTmonad.
- Addition of quicksort,quicksortM_,unstablePartitionRegionMandunsafeUnstablePartitionRegionM
0.3.1
- Addition of rangeStepInclusive'
- Addition of flatten
- makeLoadArrayhas been deprecated into- unsafeMakeLoadArray.
- A new safe makeLoadArrayShas been added.
- Fix infix 4for(...)and(..:)range functions, so they can be easily composed with numeric operations
- Addition of imapSchedulerM_andiforSchedulerM_
0.3.0
- Class hierarchy an associated methods:
- getCompmoved from- Constructto- Load
- Sizeclass lost array value parameter- e.- unsafeResizeand- unsafeExtractbecame their own classes
 
- New classes:
- Resizewith- unsafeResizefrom old- Size, except with- arraytype parameter for applicability to mutable- MArrays
- Extractwith- unsafeExtractfrom old- Size
- StrideLoad, child of- Load
 
- ifoldlIOand related no longer take list of capabilities, but instead respect the inner computation strategy. For that reason these folds have been removed:- foldlOnP,- ifoldlOnP,- foldrOnP,- ifoldrOnP
- foldnow is just like the one from- Data.Foldabletakes no arguments and requires elements to be a monoid
- singletondoes not accept computation strategy any more and creates- Seqarray by default
- New function empty.
- Raggedfunctions are no longer exported, until the interface stabilizes and proper implementation of ragged arrays is in place.
- Partial functions read',write'andswap'now live in IO and throw proper exceptions.
- loadArrayis renamed to- loadArrayMand there is a new separate function (not part of- Loadclass) with the name- loadArraythat actually uses- loadArrayM
- Moved unsafeWithPtrintoData.Massiv.Array.Unsafe
- Addition of:
- unsafeArrayToForeignPtr,
- unsafeMArrayToForeignPtr,
- unsafeArrayFromForeignPtr,
- unsafeArrayFromForeignPtr0,
- unsafeMArrayFromForeignPtr,
- unsafeMArrayFromForeignPtr0
 
- Addition of castToByteString,castFromByteString
- Addition of makeUnsafeStencil
- Windownow has an- windowUnrollIx2field.
- Addition of insertWindowanddropWindow
0.2.8.1
- Fix sqrtAfunction. Backport of #76
0.2.8
- Fixed a problem where convolution stencil size was not inverted, causing out of bounds memory read: #72
- Fixed an issue with windowed array where a stencil size is smaller than the array it is applied to
- Fixed incorrect cross-correlation stencil construction
0.2.7
- Fixed a serious performance regression in Stencil’sFunctorinstance, which was introduced in version0.2.3
- Added type and pattern synonyms Szfor future compatibility with version0.3. Could be useful for migration.
0.2.6
- Add expand*family of functions.
- Long awaited makeArrayM/makeArrayAandmapM/forM/imapM/iforM/traverseA/itraverseAalnog with corresponding functions allowing for supplying representation.
- Deprecate mapPandmapP_in favor ofmapIOandmapIO_, while making latter respect theComp.
- Addition of a whole collection of mutable operators:
- mapIO/- mapIO_/- imapIO/- imapIO_/- forIO/- forIO_/- iforIO/- iforIO_
- createArray/- createArrayST/- createArrayST_
- generateArray/- generateArrayIO
- unfoldlPrim/- unfoldlPrim_
- makeArrayA,- makeArrayAR
 
- Addition of cute synonyms: (...)and(..:)
0.2.5
- Fix for insertDimension#62
0.2.4.1
- Fix a bug in zipfunctions, where resulting array size would not take into account the size of one of the input arrays.
0.2.4
- Addition of inner folds: ifoldlInner,foldlInner,ifoldrInnerandfoldrInner
- Addition of functions that can fold over any dimension (foldlWithin,foldlWithin', etc.)
- Addition of ifoldMonoandifoldSemi, thus fixing: #54
- Improvement over manipulating index dimensions with addition of type level Dimension ndata type and functions likegetDimension,dropDimension.
- Addition of insertDimand type levelinsertDimensionas well aspullOutDimandpullOutDimension
- Add partial extractFromTo'
0.2.3
- Addition of Profunctorfunctions forStencil:lmapStencil,rmapStencilandbimapStencil
- Addition of integration approximation: Data.Massiv.Array.Numeric.Integral
- Removed overlapping instances for DWin favor of concrete instances.
- Relaxed contraint restrictions on matrix multiplication (|*|)and slightly improved performance with rewrite rules to avoid double transform.
0.2.2
- Addition of withMArray,withMArrayST.
- Improved preformance of matrix multiplication
0.2.1
- 
Addition of Strideand related functionscomputeWithStrideandcomputeWithStrideAs.
- 
Addition of Window
- 
Addition of loadArrayadnloadArrayWithStridewith default implementations that will become new loading functions in a subsequent release.loadArraywill replaceloadSandloadP, which will be deprecated in the next release and removed in the next major release. Some of this is discussed in #41
- 
Addition of various conversion functions: - fromByteString,- toByteStringand- toBuilder
- unwrapArray,- evalArray,- unwrapMutableArray,- evalMutableArray
- unwrapNormalFormArray,- evalNormalFormArray,- unwrapNormalFormMutableArray,- evalNormalFormMutableArray
 
- 
Fix: Eqinstance forArray M ix e
0.2.0
- Fixed type signatures for convertAsandconvertProxy
- Added type constructors for DWandDI
- Showinstance for- DWarrays.
- Addition of unsafeBackpermuteDW.
- Breaking changes:
- Create new Data.Massiv.Array.Stencil.Unsafemodule and moveforStencilUnsafeinto it.
- Rename of rank -> dimensions #25
- Removal EqandOrdinstances forValue#19
- Move border resolution to mapStencilfrommakeStencil.
 
- Removal 
- Updated iterators iterM,iterM_, etc. to have a separate step per dimension.
 
- Create new 
0.1.6
- Semigroupand- Monoidinstance for- Value.
- Addition of forStencilUnsafe.
- Fix minimumbehaving asmaximum.
- Addition of foldSemi.
0.1.5
- Fix inverted stencil index calculation #12
- Add support for cross-correlation.
0.1.4
- Addition of Monoidal folding foldMono.
- Expose liftArray2.
0.1.3
- Addition of withPtrandunsafeWithPtrfor Storable arrays
- Addition of computeInto.
- Exposed makeWindowedArray.
0.1.2
- Support for GHC-8.4 - instance of CompforSemigroup
- Brought back support for GHC-7.10
0.1.1
- Addition of experimental mapM,imapM,forM,iforM,generateMandgenerateLinearMfunctions. Fixes #5
- Addition of Ordinstances for some array representations.
0.1.0
- Initial Release
