Let's follow the suite of bytestring, which provides initsNE :: ByteString -> NonEmpty ByteString and tailsNE :: ByteString -> NonEmpty ByteString.
This would improve consistency between bytestring and text and dovetail nicely in the efforts to eliminate Prelude.head / Prelude.tail, allowing to use Data.List.NonEmpty.head in more situations.
For the reference, here is a relevant PR for bytestring: haskell/bytestring#557
CC @kindaro.
Let's follow the suite of
bytestring, which providesinitsNE :: ByteString -> NonEmpty ByteStringandtailsNE :: ByteString -> NonEmpty ByteString.This would improve consistency between
bytestringandtextand dovetail nicely in the efforts to eliminatePrelude.head/Prelude.tail, allowing to useData.List.NonEmpty.headin more situations.For the reference, here is a relevant PR for
bytestring: haskell/bytestring#557CC @kindaro.