Hoogle Search
Within LTS Haskell 24.31 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
clash-prelude Clash.Prelude 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
concatMap :: forall a (m :: Nat) b (n :: Nat) . (a -> Vec m b) -> Vec n a -> Vec (n * m) bclash-prelude Clash.Prelude.Safe 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.Prelude.Safe 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.Prelude.Safe 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
type
DebMap = Map BinPkgName Maybe DebianVersioncabal-debian Debian.Debianize.Prelude No documentation available.
buildDebVersionMap :: IO DebMapcabal-debian Debian.Debianize.Prelude Query versions of installed packages
dpkgFileMap :: IO (Map FilePath (Set BinPkgName))cabal-debian Debian.Debianize.Prelude Create a map from pathname to the names of the packages that contains that pathname using the contents of the debian package info directory varlibdpkginfo.
setMapMaybe :: Ord b => (a -> Maybe b) -> Set a -> Set bcabal-debian Debian.Debianize.Prelude No documentation available.
zipMaps :: Ord k => (k -> Maybe a -> Maybe b -> Maybe c) -> Map k a -> Map k b -> Map k ccabal-debian Debian.Debianize.Prelude No documentation available.
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]calligraphy Calligraphy.Prelude Map a function over all the elements of a container and concatenate the resulting lists.
Examples
Basic usage:>>> concatMap (take 3) [[1..], [10..], [100..], [1000..]] [1,2,3,10,11,12,100,101,102,1000,1001,1002]
>>> concatMap (take 3) (Just [1..]) [1,2,3]