Opened 7 years ago

Closed 7 years ago

Last modified 3 months ago

#971 closed proposal (fixed)

Add intercalate to Data.List

Reported by: josef Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 6.6
Keywords: Cc: libraries@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Add a function equal to concat (intersperse x xs)

The initial mail for this proposal and the following discussion can be found here:
http://www.haskell.org/pipermail/libraries/2006-October/005917.html

A summary of the discussion:

Accepting the patch

A lot of people agreed that including a function such as intercalate in the libraries would be a good thing. Indeed, many said they already had such a function in their own libraries.
Jon Fairbairn argued against giving a name to such a short idiom and this was supported by Ketil Malde.

The submitter interpreted this as a clear majority in favour of this patch.

The name 'intercalate'

The original proposal for the name was join. Since it clashes with Control.Monad.join it was deemed inappropriate. Many other names were suggested: separateWith, sepBy, joinWith, concatIntersperse, consperse, intercat, connect, concatInter and intercalate. The original submitter decided for 'intercalate'. A number people said they agreed with this. One person said he preferred joinWith but others argued against that. Some people expressed their concerns against such an uncommon word being used and suggested that there should be some explanation for it. It was agreed that there should be an explanation somewhere on the Wiki.

Split

Bulat Ziganshin suggested also adding a function split which is a right inverse of intercalate. Donald Steward seemed to agree with this decision. No one else raised their voice about this so it seems uncontroversial.

Attachments (2)

libpatch (36.2 KB) - added by josef 7 years ago.
The patch for adding Data.List.intercalate
testpatch (33.0 KB) - added by josef 7 years ago.
Some QuickCheck? properties for Data.List.intercalate

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by ross

  • Cc libraries@… added
  • Component changed from Compiler to libraries/base

comment:2 Changed 7 years ago by josef

  • Summary changed from Add intercalate and split to Data.List to Add intercalate to Data.List

Accepting the patch, take 2

Jon Fairbairn:
"For the case of intercalate, if everyone who is in favour of
its inclusion has read my arguments and remains unswayed,
then it should surely go in."

So it seems we have a consensus about the inclusion of intercalate.

Split, take 2

It seems that there is a large design space for split and related functions. It needs its own proposal and discussion. I'm pulling it out of this patch.

Deadline

Since we've had quite a lot of discussion on this already I'm setting a fairly tight deadline now: Monday Nov 6 2006.

Changed 7 years ago by josef

The patch for adding Data.List.intercalate

Changed 7 years ago by josef

Some QuickCheck? properties for Data.List.intercalate

comment:3 Changed 7 years ago by josef

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:6 Changed 3 months ago by Josef Svenningsson <josef.svenningsson@…>

In d40e957486043606b76e3cd60d541131e71085a4/ghc:

Add tests for Data.List.intercalate (ticket #971)
Note: See TracTickets for help on using tickets.