Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
diagrams-lib Diagrams.Prelude Monadic fold over the elements of a structure with an index, associating to the left. When you don't need access to the index then foldlMOf is more flexible in what it accepts.
foldlMOf l ≡ ifoldlMOf l . const
ifoldlMOf :: Monad m => IndexedGetter i s a -> (i -> r -> a -> m r) -> r -> s -> m r ifoldlMOf :: Monad m => IndexedFold i s a -> (i -> r -> a -> m r) -> r -> s -> m r ifoldlMOf :: Monad m => IndexedLens' i s a -> (i -> r -> a -> m r) -> r -> s -> m r ifoldlMOf :: Monad m => IndexedTraversal' i s a -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlOf :: IndexedGetting i (Dual (Endo r)) s a -> (i -> r -> a -> r) -> r -> s -> rdiagrams-lib Diagrams.Prelude Left-associative fold of the parts of a structure that are viewed through an IndexedFold or IndexedTraversal with access to the i. When you don't need access to the index then foldlOf is more flexible in what it accepts.
foldlOf l ≡ ifoldlOf l . const
ifoldlOf :: IndexedGetter i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf :: IndexedFold i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf :: IndexedLens' i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf :: IndexedTraversal' i s a -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> rdiagrams-lib Diagrams.Prelude Fold over the elements of a structure with an index, associating to the left, but strictly. When you don't need access to the index then foldlOf' is more flexible in what it accepts.
foldlOf' l ≡ ifoldlOf' l . const
ifoldlOf' :: IndexedGetter i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf' :: IndexedFold i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf' :: IndexedLens' i s a -> (i -> r -> a -> r) -> r -> s -> r ifoldlOf' :: IndexedTraversal' i s a -> (i -> r -> a -> r) -> r -> s -> r
-
singletons-base Prelude.Singletons No documentation available.
-
singletons-base Prelude.Singletons No documentation available.
ifoldl :: forall (n :: Nat) a b . KnownNat n => (a -> Index n -> b -> a) -> a -> Vec n b -> aclash-prelude Clash.Explicit.Prelude Left fold (function applied to each element and its index)
>>> let findRightmost x xs = ifoldl (\a i b -> if b == x then Just i else a) Nothing xs >>> findRightmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil) Just 4 >>> findRightmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil) Nothing
"ifoldl f z xs" corresponds to the following circuit layout:ifoldl :: forall (n :: Nat) a b . KnownNat n => (a -> Index n -> b -> a) -> a -> Vec n b -> aclash-prelude Clash.Explicit.Prelude.Safe Left fold (function applied to each element and its index)
>>> let findRightmost x xs = ifoldl (\a i b -> if b == x then Just i else a) Nothing xs >>> findRightmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil) Just 4 >>> findRightmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil) Nothing
"ifoldl f z xs" corresponds to the following circuit layout:ifoldl :: forall (n :: Nat) a b . KnownNat n => (a -> Index n -> b -> a) -> a -> Vec n b -> aclash-prelude Clash.Prelude Left fold (function applied to each element and its index)
>>> let findRightmost x xs = ifoldl (\a i b -> if b == x then Just i else a) Nothing xs >>> findRightmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil) Just 4 >>> findRightmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil) Nothing
"ifoldl f z xs" corresponds to the following circuit layout:ifoldl :: forall (n :: Nat) a b . KnownNat n => (a -> Index n -> b -> a) -> a -> Vec n b -> aclash-prelude Clash.Prelude.Safe Left fold (function applied to each element and its index)
>>> let findRightmost x xs = ifoldl (\a i b -> if b == x then Just i else a) Nothing xs >>> findRightmost 3 (1:>3:>2:>4:>3:>5:>6:>Nil) Just 4 >>> findRightmost 8 (1:>3:>2:>4:>3:>5:>6:>Nil) Nothing
"ifoldl f z xs" corresponds to the following circuit layout: