Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
DeferredFolds.UnfoldlM
Synopsis
- newtype UnfoldlM m a = UnfoldlM (forall x. (x -> a -> m x) -> x -> m x)
- fold :: Fold input output -> UnfoldlM Identity input -> output
- foldM :: Monad m => FoldM m input output -> UnfoldlM m input -> m output
- mapM_ :: Monad m => (input -> m ()) -> UnfoldlM m input -> m ()
- unfoldr :: Monad m => Unfoldr a -> UnfoldlM m a
- forM_ :: Monad m => UnfoldlM m input -> (input -> m ()) -> m ()
- null :: Monad m => UnfoldlM m input -> m Bool
- filter :: Monad m => (a -> m Bool) -> UnfoldlM m a -> UnfoldlM m a
- foldlM' :: Monad m => (output -> input -> m output) -> output -> UnfoldlM m input -> m output
- foldable :: (Monad m, Foldable foldable) => foldable a -> UnfoldlM m a
- mapFoldMInput :: Monad m => (forall x. FoldM m b x -> FoldM m a x) -> UnfoldlM m a -> UnfoldlM m b
- foldlRunner :: Monad m => (forall x. (x -> a -> x) -> x -> x) -> UnfoldlM m a
- foldrRunner :: Monad m => (forall x. (a -> x -> x) -> x -> x) -> UnfoldlM m a
- intsInRange :: Monad m => Int -> Int -> UnfoldlM m Int
- tVarValue :: TVar a -> UnfoldlM STM a
- hoist :: (forall a. m a -> n a) -> (forall a. n a -> m a) -> UnfoldlM m a -> UnfoldlM n a
- byteStringBytes :: ByteString -> UnfoldlM IO Word8
- shortByteStringBytes :: Monad m => ShortByteString -> UnfoldlM m Word8
- primArray :: (Monad m, Prim prim) => PrimArray prim -> UnfoldlM m prim
- primArrayWithIndices :: (Monad m, Prim prim) => PrimArray prim -> UnfoldlM m (Int, prim)
Documentation
A monadic variation of DeferredFolds.Unfoldl
Constructors
UnfoldlM (forall x. (x -> a -> m x) -> x -> m x) |
Instances
MonadTrans UnfoldlM | |
Defined in DeferredFolds.Defs.UnfoldlM | |
Foldable (UnfoldlM Identity) | |
Defined in DeferredFolds.Defs.UnfoldlM Methods fold :: Monoid m => UnfoldlM Identity m -> m foldMap :: Monoid m => (a -> m) -> UnfoldlM Identity a -> m foldMap' :: Monoid m => (a -> m) -> UnfoldlM Identity a -> m foldr :: (a -> b -> b) -> b -> UnfoldlM Identity a -> b foldr' :: (a -> b -> b) -> b -> UnfoldlM Identity a -> b foldl :: (b -> a -> b) -> b -> UnfoldlM Identity a -> b foldl' :: (b -> a -> b) -> b -> UnfoldlM Identity a -> b foldr1 :: (a -> a -> a) -> UnfoldlM Identity a -> a foldl1 :: (a -> a -> a) -> UnfoldlM Identity a -> a toList :: UnfoldlM Identity a -> [a] null :: UnfoldlM Identity a -> Bool length :: UnfoldlM Identity a -> Int elem :: Eq a => a -> UnfoldlM Identity a -> Bool maximum :: Ord a => UnfoldlM Identity a -> a minimum :: Ord a => UnfoldlM Identity a -> a | |
Monad m => Alternative (UnfoldlM m) | |
Monad m => Applicative (UnfoldlM m) | |
Defined in DeferredFolds.Defs.UnfoldlM | |
Functor m => Functor (UnfoldlM m) | |
Monad m => Monad (UnfoldlM m) | |
Monad m => MonadPlus (UnfoldlM m) | |
Monad m => Monoid (UnfoldlM m a) | |
Monad m => Semigroup (UnfoldlM m a) | |
IsList (UnfoldlM Identity a) | |
Show a => Show (UnfoldlM Identity a) | |
Eq a => Eq (UnfoldlM Identity a) | |
type Item (UnfoldlM Identity a) | |
Defined in DeferredFolds.Defs.UnfoldlM type Item (UnfoldlM Identity a) = a |
foldM :: Monad m => FoldM m input output -> UnfoldlM m input -> m output Source #
Apply a monadic Gonzalez fold
mapM_ :: Monad m => (input -> m ()) -> UnfoldlM m input -> m () Source #
A more efficient implementation of mapM_
forM_ :: Monad m => UnfoldlM m input -> (input -> m ()) -> m () Source #
Same as mapM_
with arguments flipped
filter :: Monad m => (a -> m Bool) -> UnfoldlM m a -> UnfoldlM m a Source #
Filter the values given a predicate
foldlM' :: Monad m => (output -> input -> m output) -> output -> UnfoldlM m input -> m output Source #
Perform a monadic strict left fold
foldable :: (Monad m, Foldable foldable) => foldable a -> UnfoldlM m a Source #
Construct from any foldable
mapFoldMInput :: Monad m => (forall x. FoldM m b x -> FoldM m a x) -> UnfoldlM m a -> UnfoldlM m b Source #
Lift a fold input mapping function into a mapping of unfolds
foldlRunner :: Monad m => (forall x. (x -> a -> x) -> x -> x) -> UnfoldlM m a Source #
Construct from a specification of how to execute a left-fold
foldrRunner :: Monad m => (forall x. (a -> x -> x) -> x -> x) -> UnfoldlM m a Source #
Construct from a specification of how to execute a right-fold
intsInRange :: Monad m => Int -> Int -> UnfoldlM m Int Source #
Ints in the specified inclusive range
hoist :: (forall a. m a -> n a) -> (forall a. n a -> m a) -> UnfoldlM m a -> UnfoldlM n a Source #
Change the base monad using invariant natural transformations
byteStringBytes :: ByteString -> UnfoldlM IO Word8 Source #
Bytes of a bytestring
shortByteStringBytes :: Monad m => ShortByteString -> UnfoldlM m Word8 Source #
Bytes of a short bytestring
primArray :: (Monad m, Prim prim) => PrimArray prim -> UnfoldlM m prim Source #
Elements of a prim array
primArrayWithIndices :: (Monad m, Prim prim) => PrimArray prim -> UnfoldlM m (Int, prim) Source #
Elements of a prim array coming paired with indices