{"id":24994323,"url":"https://github.com/noughtmare/fleet-array","last_synced_at":"2026-02-14T23:02:52.058Z","repository":{"id":274106105,"uuid":"921906379","full_name":"noughtmare/fleet-array","owner":"noughtmare","description":"A modern implementation of diff arrays","archived":false,"fork":false,"pushed_at":"2025-03-12T19:27:12.000Z","size":63,"stargazers_count":1,"open_issues_count":14,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T10:41:50.431Z","etag":null,"topics":["array","data-structures","persistent-data-structure"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noughtmare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-24T21:01:30.000Z","updated_at":"2025-03-12T19:27:16.000Z","dependencies_parsed_at":"2025-03-12T20:33:50.708Z","dependency_job_id":null,"html_url":"https://github.com/noughtmare/fleet-array","commit_stats":null,"previous_names":["noughtmare/diffarray","noughtmare/fleet-array"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noughtmare/fleet-array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Ffleet-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Ffleet-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Ffleet-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Ffleet-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noughtmare","download_url":"https://codeload.github.com/noughtmare/fleet-array/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Ffleet-array/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266332534,"owners_count":23912662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","data-structures","persistent-data-structure"],"created_at":"2025-02-04T14:52:28.150Z","updated_at":"2026-02-14T23:02:47.028Z","avatar_url":"https://github.com/noughtmare.png","language":"Haskell","readme":"# Fleet Array\n\nSituation:\n\n* There is one essential idea that I must explain properly. Usually in Haskell\n  you think of everything as a value. However, under the hood most things are\n  implemented using references. Everytime I say \"old version\" or \"old\n  reference\", I refer to this implementation detail. There is no way to really\n  explain it without explaining how references are used in the implementation of\n  Haskell.\n\n* Using immutable data structures makes it easier to reason about your programs\n  (motivation)\n* All references to an immutable data structure have the same value\n  (restriction)\n* Mutation can always be avoided by creating a modified copy instead (bad\n  previous solution).\n* Copying can be cheap, if the data that needs to be copied is not much larger\n  than the data that has been changed\n* That happens, for example, when changing the first element of a linked list.\n  The remainder of the list can be shared in memory.\n\nComplication (why is it bad?):\n\n* Arrays, on the other hand, are an example of a data structure where changes\n  can be much smaller than the copied data.\n* In an array, changing a single element would necessitate a copy of the entire\n  array.\n* Thus, such copying unfortunately has a high performance cost.\n* Copying can turn constant-time operations into linear-time operations (and\n  linear-time into quadratic-time, etc.).\n\nQuestion:\n\n* How can we avoid mutation without resorting to expensive copying?\n\nAnswer:\n\n* Do the mutation, but keep track of changes\n* Old references to the same data will be mutated in an equal but opposite way\n* Whenever the old version is used after the mutation, reapply the changes\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoughtmare%2Ffleet-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoughtmare%2Ffleet-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoughtmare%2Ffleet-array/lists"}