Data.Semigroup.Foldable
- Package
- purescript-foldable-traversable
- Repository
- purescript/purescript-foldable-traversable
#Foldable1 Source
class (Foldable t) <= Foldable1 t whereFoldable1 represents data structures with a minimum of one element that can be folded.
fold1folds a structure using aSemigroupinstancefoldMap1folds a structure by accumulating values in aSemigroup
Default implementations are provided by the following functions:
fold1DefaultfoldMap1Default
Note: some combinations of the default implementations are unsafe to use together - causing a non-terminating mutually recursive cycle. These combinations are documented per function.
Members
foldMap1 :: forall m a. Semigroup m => (a -> m) -> t a -> mfold1 :: forall m. Semigroup m => t m -> m
Instances
#traverse1_ Source
traverse1_ :: forall b a f t. Foldable1 t => Apply f => (a -> f b) -> t a -> f UnitTraverse a data structure, performing some effects encoded by an
Apply instance at each value, ignoring the final result.
#sequence1_ Source
sequence1_ :: forall a f t. Foldable1 t => Apply f => t (f a) -> f UnitPerform all of the effects in some data structure in the order
given by the Foldable1 instance, ignoring the final result.
#foldMap1Default Source
foldMap1Default :: forall a m t. Foldable1 t => Functor t => Semigroup m => (a -> m) -> t a -> mA default implementation of foldMap1 using fold1.
#fold1Default Source
fold1Default :: forall m t. Foldable1 t => Semigroup m => t m -> mA default implementation of fold1 using foldMap1.
#intercalate Source
intercalate :: forall m f. Foldable1 f => Semigroup m => m -> f m -> mFold a data structure using a Semigroup instance,
combining adjacent elements using the specified separator.
#intercalateMap Source
intercalateMap :: forall a m f. Foldable1 f => Semigroup m => m -> (a -> m) -> f a -> mFold a data structure, accumulating values in some Semigroup,
combining adjacent elements using the specified separator.