module Data.List.NonEmpty.Util where import Data.List.NonEmpty (NonEmpty(..)) sconcatne :: Semigroup s => NonEmpty s -> s sconcatne = \(x :| xs) -> go x xs where go a [] = a go a (x : xs) = go (a <> x) xs foldMapne :: Semigroup s => (a -> s) -> NonEmpty a -> s foldMapne f = sconcatne . fmap f