Opened 11 years ago

Closed 11 years ago

Last modified 4 years 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: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Add a function equal to concat (intersperse x xs)

The initial mail for this proposal and the following discussion can be found here:

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.


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 11 years ago.
The patch for adding Data.List.intercalate
testpatch (33.0 KB) - added by josef 11 years ago.
Some QuickCheck properties for Data.List.intercalate

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by ross

Cc: libraries@… added
Component: Compilerlibraries/base

comment:2 Changed 11 years ago by josef

Summary: Add intercalate and split to Data.ListAdd 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.


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 11 years ago by josef

Attachment: libpatch added

The patch for adding Data.List.intercalate

Changed 11 years ago by josef

Attachment: testpatch added

Some QuickCheck properties for Data.List.intercalate

comment:3 Changed 11 years ago by josef

Resolution: fixed
Status: newclosed

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:6 Changed 4 years 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.