Skip to content

base: Add inits1 and tails1 to Data.List

This implements https://github.com/haskell/core-libraries-committee/issues/252

Where is the key part of this patch? That is, what should reviewers look at first?

The new functions are defined here: libraries/ghc-internal/src/GHC/Internal/Data/List.hs. Is that best? They could also go directly in Data.List if Data.List.NonEmpty gains a dependency on Data.List. I don't really know the relevant pros and cons here.

I can't add the user-facing label myself, I think, but per the below it should be added. Only potential breakage I can think of is if someone has imported Data.List and has inits1 or tails1 either defined themselves or imported from Data.List.NonEmpty.


Merge checklist:

  • if your MR may break existing programs (e.g. touches base or causes the compiler to reject programs), please describe the expected breakage and add the user-facing label. This will run ghc/head.hackage> to characterise the effect of your change on Hackage.
  • ensure that your commits are either individually buildable or squashed
  • ensure that your commit messages describe what they do (referring to tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a [Note][notes] and cross-reference it from the relevant places.
  • add a [testcase to the testsuite][adding test].
  • updates the users guide if applicable
  • mentions new features in the release notes for the next release
Edited by Ryan Hendrickson

Merge request reports