1
vote
Vote UpVote

What Is the Name of This Function?

Craig Stuntz's Weblog – There is a function I need. I know how to write it, but I don’t know what it’s called. It takes one argument — a list of something — and returns a list of 2-tuples of equal length. Each tuple contains one item from the list and the list without that item. It’s probably easiest if I show you an example: > f [1; 2; 3];; val it : (int * int list) list = [ (1, [2; 3]) (2, [1; 3]) (3, [1; 2]) ] Here’s the implementation I’m using: let f (items : 'T list) = let rec implementation (start : 'T list) = function | [] -> [] ...
Favorite? Off-Topic? Craig Stuntz @ 2014-11-11 20:33

Statistics

Visits: 1096
Votes: 1
Favorites: 0
Off-Topic: 2

Visits by Source

User Actions

Users who voted for this posting

Primoz Gabrijelcic
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)