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.

  1. sum_ :: (Monad m, Num a) => Stream (Of a) m () -> m a

    streaming Streaming.Prelude

    Fold a Stream of numbers into their sum

  2. summaryBuffer :: Buffer a -> String

    ghc-internal GHC.Internal.IO.Buffer

    No documentation available.

  3. sumOf :: Num a => Fold s t a b -> s -> a

    lens-family Lens.Family2

    Returns the sum of all the referenced values.

  4. sumArrays' :: (HasCallStack, Foldable t, Load r ix e, Numeric r e) => t (Array r ix e) -> Array r ix e

    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.

  5. sumArraysM :: (Foldable t, Load r ix e, Numeric r e, MonadThrow m) => t (Array r ix e) -> m (Array r ix e)

    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 ]
    ]
    

  6. sumStencil :: (Num e, Index ix) => Sz ix -> Stencil ix e e

    massiv 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]
    

  7. sumArray :: (FoldNumeric r e, Index ix) => Array r ix e -> e

    massiv Data.Massiv.Core.Operations

    Compute sum of all elements in the array

  8. summary :: HasSummary s a => Lens' s a

    openapi3 Data.OpenApi.Lens

    No documentation available.

  9. sumEncoding :: SchemaOptions -> SumEncoding

    openapi3 Data.OpenApi.ParamSchema

    Specifies how to encode constructors of a sum datatype.

  10. sumEncoding :: SchemaOptions -> SumEncoding

    openapi3 Data.OpenApi.Schema

    Specifies how to encode constructors of a sum datatype.

Page 45 of many | Previous | Next