class (Foldable1 t, Traversable t) <= Traversable1 t where
Traversable1 represents data structures with a minimum of one element that can be traversed,
accumulating results and effects in some
traverse1runs an action for every element in a data structure, and accumulates the results.
sequence1runs the actions contained in a data structure, and accumulates the results.
sequence1 functions should be compatible in the
traverse1 f xs = sequence1 (f <$> xs)
sequence1 = traverse1 identity
Traversable1 instances should also be compatible with the corresponding
Foldable1 instances, in the following sense:
foldMap1 f = runConst <<< traverse1 (Const <<< f)
Default implementations are provided by the following functions:
traverse1 :: forall a b f. Apply f => (a -> f b) -> t a -> f (t b)
sequence1 :: forall b f. Apply f => t (f b) -> f (t b)