Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sum_ :: (Monad m, Num a) => Stream (Of a) m () -> m astreaming Streaming.Prelude Fold a Stream of numbers into their sum
summaryBuffer :: Buffer a -> Stringghc-internal GHC.Internal.IO.Buffer No documentation available.
sumOf :: Num a => Fold s t a b -> s -> alens-family Lens.Family2 Returns the sum of all the referenced values.
-
massiv Data.Massiv.Array.Numeric Same as sumArraysM, compute sum of arrays pointwise. All arrays must have the same size, otherwise it will result in an error.
-
massiv Data.Massiv.Array.Numeric Compute sum of arrays pointwise. All arrays must have the same size.
Examples
>>> import Data.Massiv.Array as A >>> sumArraysM [] :: IO (Array P Ix3 Int) Array P Seq (Sz (0 :> 0 :. 0)) [ ] >>> arr = A.makeArrayR P Seq (Sz3 4 5 6) $ \(i :> j :. k) -> i + j * k >>> arr Array P Seq (Sz (4 :> 5 :. 6)) [ [ [ 0, 0, 0, 0, 0, 0 ] , [ 0, 1, 2, 3, 4, 5 ] , [ 0, 2, 4, 6, 8, 10 ] , [ 0, 3, 6, 9, 12, 15 ] , [ 0, 4, 8, 12, 16, 20 ] ] , [ [ 1, 1, 1, 1, 1, 1 ] , [ 1, 2, 3, 4, 5, 6 ] , [ 1, 3, 5, 7, 9, 11 ] , [ 1, 4, 7, 10, 13, 16 ] , [ 1, 5, 9, 13, 17, 21 ] ] , [ [ 2, 2, 2, 2, 2, 2 ] , [ 2, 3, 4, 5, 6, 7 ] , [ 2, 4, 6, 8, 10, 12 ] , [ 2, 5, 8, 11, 14, 17 ] , [ 2, 6, 10, 14, 18, 22 ] ] , [ [ 3, 3, 3, 3, 3, 3 ] , [ 3, 4, 5, 6, 7, 8 ] , [ 3, 5, 7, 9, 11, 13 ] , [ 3, 6, 9, 12, 15, 18 ] , [ 3, 7, 11, 15, 19, 23 ] ] ] >>> sumArraysM $ outerSlices arr Array P Seq (Sz (5 :. 6)) [ [ 6, 6, 6, 6, 6, 6 ] , [ 6, 10, 14, 18, 22, 26 ] , [ 6, 14, 22, 30, 38, 46 ] , [ 6, 18, 30, 42, 54, 66 ] , [ 6, 22, 38, 54, 70, 86 ] ] >>> sumArraysM $ innerSlices arr Array D Seq (Sz (4 :. 5)) [ [ 0, 15, 30, 45, 60 ] , [ 6, 21, 36, 51, 66 ] , [ 12, 27, 42, 57, 72 ] , [ 18, 33, 48, 63, 78 ] ]
sumStencil :: (Num e, Index ix) => Sz ix -> Stencil ix e emassiv Data.Massiv.Array.Stencil Sum all elements in the stencil region
Examples
>>> import Data.Massiv.Array as A >>> a = computeAs P $ iterateN (Sz2 2 5) (* 2) (1 :: Int) >>> a Array P Seq (Sz (2 :. 5)) [ [ 2, 4, 8, 16, 32 ] , [ 64, 128, 256, 512, 1024 ] ] >>> applyStencil noPadding (sumStencil (Sz2 1 2)) a Array DW Seq (Sz (2 :. 4)) [ [ 6, 12, 24, 48 ] , [ 192, 384, 768, 1536 ] ] >>> [2 + 4, 4 + 8, 8 + 16, 16 + 32] :: [Int] [6,12,24,48]
sumArray :: (FoldNumeric r e, Index ix) => Array r ix e -> emassiv Data.Massiv.Core.Operations Compute sum of all elements in the array
summary :: HasSummary s a => Lens' s aopenapi3 Data.OpenApi.Lens No documentation available.
sumEncoding :: SchemaOptions -> SumEncodingopenapi3 Data.OpenApi.ParamSchema Specifies how to encode constructors of a sum datatype.
sumEncoding :: SchemaOptions -> SumEncodingopenapi3 Data.OpenApi.Schema Specifies how to encode constructors of a sum datatype.