Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
concatMap :: forall a (m :: Nat) b (n :: Nat) . (a -> Vec m b) -> Vec n a -> Vec (n * m) bclash-prelude Clash.Sized.Vector Map a function over all the elements of a vector and concatentate the resulting vectors.
>>> concatMap (replicate d3) (1:>2:>3:>Nil) 1 :> 1 :> 1 :> 2 :> 2 :> 2 :> 3 :> 3 :> 3 :> Nil
imap :: forall (n :: Nat) a b . KnownNat n => (Index n -> a -> b) -> Vec n a -> Vec n bclash-prelude Clash.Sized.Vector Apply a function of every element of a vector and its index.
>>> :t imap (+) (2 :> 2 :> 2 :> 2 :> Nil) imap (+) (2 :> 2 :> 2 :> 2 :> Nil) :: Vec 4 (Index 4) >>> imap (+) (2 :> 2 :> 2 :> 2 :> Nil) 2 :> 3 :> *** Exception: X: Clash.Sized.Index: result 4 is out of bounds: [0..3] ... >>> imap (\i a -> extend (bitCoerce i) + a) (2 :> 2 :> 2 :> 2 :> Nil) :: Vec 4 (Unsigned 8) 2 :> 3 :> 4 :> 5 :> Nil
"imap f xs" corresponds to the following circuit layout:-
clash-prelude Clash.Sized.Vector Apply a function to every element of a vector and the element's position (as an SNat value) in the vector.
>>> let rotateMatrix = smap (flip rotateRightS) >>> let xss = (1:>2:>3:>Nil):>(1:>2:>3:>Nil):>(1:>2:>3:>Nil):>Nil >>> xss (1 :> 2 :> 3 :> Nil) :> (1 :> 2 :> 3 :> Nil) :> (1 :> 2 :> 3 :> Nil) :> Nil >>> rotateMatrix xss (1 :> 2 :> 3 :> Nil) :> (3 :> 1 :> 2 :> Nil) :> (2 :> 3 :> 1 :> Nil) :> Nil
-
classy-prelude-conduit ClassyPrelude.Conduit concatMap with an accumulator.
concatMapAccumMC :: Monad m => (a -> accum -> m (accum, [b])) -> accum -> ConduitT a b m ()classy-prelude-conduit ClassyPrelude.Conduit concatMapM with an accumulator.
-
classy-prelude-conduit ClassyPrelude.Conduit Apply the function to each value in the stream, resulting in a foldable value (e.g., a list). Then yield each of the individual values in that foldable value separately. Generalizes concatMap, mapMaybe, and mapFoldable.
-
classy-prelude-conduit ClassyPrelude.Conduit Apply the function to each element in the chunked stream, resulting in a foldable value (e.g., a list). Then yield each of the individual values in that foldable value separately. Generalizes concatMap, mapMaybe, and mapFoldable.
concatMapMC :: (Monad m, MonoFoldable mono) => (a -> m mono) -> ConduitT a (Element mono) m ()classy-prelude-conduit ClassyPrelude.Conduit Apply the monadic function to each value in the stream, resulting in a foldable value (e.g., a list). Then yield each of the individual values in that foldable value separately. Generalizes concatMapM, mapMaybeM, and mapFoldableM.
foldMapC :: forall (m :: Type -> Type) b a o . (Monad m, Monoid b) => (a -> b) -> ConduitT a o m bclassy-prelude-conduit ClassyPrelude.Conduit Apply the provided mapping function and monoidal combine all values.
-
classy-prelude-conduit ClassyPrelude.Conduit Apply the provided mapping function and monoidal combine all elements of the chunked stream.