Hoogle Search

Within LTS Haskell 24.32 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. productMaybeWith :: (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]

    leancheck Test.LeanCheck.Tiers

    Take the product of lists of tiers by a function returning a Maybe value discarding Nothing values.

  2. products :: [[[a]]] -> [[[a]]]

    leancheck Test.LeanCheck.Tiers

    Takes the product of N lists of tiers, producing lists of length N. Alternatively, takes as argument a list of lists of tiers of elements; returns lists combining elements of each list of tiers.

    products [xss]  =  mapT (:[]) xss
    products [xss,yss]  =  mapT (\(x,y) -> [x,y]) (xss >< yss)
    products [xss,yss,zss]  =  product3With (\x y z -> [x,y,z]) xss yss zss
    

  3. productTypeFrom :: forall a (xs :: [Type]) . IsProductType a xs => a -> NP I xs

    generics-sop Generics.SOP

    Convert from a product type to its product representation.

  4. productTypeTo :: forall a (xs :: [Type]) . IsProductType a xs => NP I xs -> a

    generics-sop Generics.SOP

    Convert a product representation to the original type.

  5. productTypeFrom :: forall a (xs :: [Type]) . IsProductType a xs => a -> NP I xs

    generics-sop Generics.SOP.Universe

    Convert from a product type to its product representation.

  6. productTypeTo :: forall a (xs :: [Type]) . IsProductType a xs => NP I xs -> a

    generics-sop Generics.SOP.Universe

    Convert a product representation to the original type.

  7. product_ :: (Monad m, Num a) => Stream (Of a) m () -> m a

    streaming Streaming.Prelude

    Fold a Stream of numbers into their product

  8. productOf :: Num a => Fold s t a b -> s -> a

    lens-family Lens.Family2

    Returns the product of all the referenced values.

  9. productArrays' :: (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 productArraysM. Compute product of arrays pointwise. All arrays must have the same size, otherwise it will result in an error.

  10. productArraysM :: (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 product of arrays pointwise. All arrays must have the same size.

    Examples

    >>> import Data.Massiv.Array as A
    
    >>> productArraysM [] :: 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 ]
    ]
    ]
    
    >>> productArraysM $ outerSlices arr
    Array P Seq (Sz (5 :. 6))
    [ [ 0, 0, 0, 0, 0, 0 ]
    , [ 0, 24, 120, 360, 840, 1680 ]
    , [ 0, 120, 840, 3024, 7920, 17160 ]
    , [ 0, 360, 3024, 11880, 32760, 73440 ]
    , [ 0, 840, 7920, 32760, 93024, 212520 ]
    ]
    
    >>> productArraysM $ innerSlices arr
    Array D Seq (Sz (4 :. 5))
    [ [ 0, 0, 0, 0, 0 ]
    , [ 1, 720, 10395, 58240, 208845 ]
    , [ 64, 5040, 46080, 209440, 665280 ]
    , [ 729, 20160, 135135, 524880, 1514205 ]
    ]
    

Page 75 of many | Previous | Next