{"id":32076,"date":"2021-04-06T16:05:02","date_gmt":"2021-04-06T20:05:02","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=32076"},"modified":"2021-04-06T16:05:02","modified_gmt":"2021-04-06T20:05:02","slug":"swift-collections-package","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2021\/04\/06\/swift-collections-package\/","title":{"rendered":"Swift &ldquo;Collections&rdquo; Package"},"content":{"rendered":"<p><a href=\"https:\/\/swift.org\/blog\/swift-collections\/\">Karoy Lorentey<\/a> (<a href=\"https:\/\/twitter.com\/lorentey\/status\/1379195584536485888\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/swift.org\/blog\/swift-collections\/\"><p>I&rsquo;m thrilled to announce <a href=\"https:\/\/github.com\/apple\/swift-collections\">Swift Collections<\/a>, a new open-source package focused on extending the set of available Swift data structures. Like the <a href=\"https:\/\/github.com\/apple\/swift-algorithms\">Swift Algorithms<\/a> and <a href=\"https:\/\/github.com\/apple\/swift-numerics\">Swift Numerics<\/a> packages before it, we&rsquo;re releasing Swift Collections to help incubate new functionality for the Swift Standard Library.<\/p><p>[&#8230;]<\/p><p>The main benefit of <code>Deque<\/code> over <code>Array<\/code> is that it supports efficient insertions and removals at both ends.<\/p><p>[&#8230;]<\/p><p><a href=\"https:\/\/github.com\/apple\/swift-collections\/blob\/main\/Documentation\/OrderedSet.md\"><code>OrderedSet<\/code><\/a> is a powerful hybrid of an <code>Array<\/code> and a <code>Set<\/code>.<\/p><p>[&#8230;]<\/p><p><a href=\"https:\/\/github.com\/apple\/swift-collections\/blob\/main\/Documentation\/OrderedDictionary.md\"><code>OrderedDictionary<\/code><\/a> is a useful alternative to <code>Dictionary<\/code> when the order of elements is important or we need to be able to efficiently access elements at various positions within the collection.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/10\/08\/swift-algorithms-package\/\">Swift &ldquo;Algorithms&rdquo; Package<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/10\/02\/introducing-swift-atomics\/\">Introducing Swift Atomics<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/09\/25\/swift-system-is-now-open-source\/\">Swift System Is Now Open Source<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/02\/28\/swift-argument-parser\/\">Swift Argument Parser<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/11\/08\/swift-numerics\/\">Swift Numerics<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Karoy Lorentey (tweet): I&rsquo;m thrilled to announce Swift Collections, a new open-source package focused on extending the set of available Swift data structures. Like the Swift Algorithms and Swift Numerics packages before it, we&rsquo;re releasing Swift Collections to help incubate new functionality for the Swift Standard Library.[&#8230;]The main benefit of Deque over Array is that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2021-04-06T20:05:05Z","apple_news_api_id":"c883c55d-e3f8-4896-b3b0-b0e1228b02d0","apple_news_api_modified_at":"2021-04-06T20:05:05Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AyIPFXeP4SJazsLDhIosC0A","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[31,1837,30,1891,74,71,901],"class_list":["post-32076","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-ios-14","tag-mac","tag-macos-11-0","tag-opensource","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/32076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=32076"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/32076\/revisions"}],"predecessor-version":[{"id":32077,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/32076\/revisions\/32077"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=32076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=32076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=32076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}