Many of the supported types have the functions inits :: a -> [a] and tails :: a -> [a] which are very useful, but they are missing from mono-traversable.
If there is not a native inits and tails defined for the type there is an easy default implementation leveraging initMay and tailMay which are already defined in mono-traversable.
I also think including initTails :: a -> [(a,a)] (a zip of inits and tails) would be helpful so that types like [a] and Seq a can have a faster implementation to get the list of splits.
Let me know if this is something you would be interested in me implementing for mono-traversable.
Many of the supported types have the functions
inits :: a -> [a]
andtails :: a -> [a]
which are very useful, but they are missing from mono-traversable.If there is not a native
inits
andtails
defined for the type there is an easy default implementation leveraginginitMay
andtailMay
which are already defined in mono-traversable.I also think including
initTails :: a -> [(a,a)]
(a zip of inits and tails) would be helpful so that types like[a]
andSeq a
can have a faster implementation to get the list of splits.Let me know if this is something you would be interested in me implementing for mono-traversable.