{"id":17771284,"url":"https://github.com/lue-bird/elm-partial-or-complete","last_synced_at":"2025-10-06T15:11:41.132Z","repository":{"id":158788589,"uuid":"634251987","full_name":"lue-bird/elm-partial-or-complete","owner":"lue-bird","description":"keep going with a partial value or stop with the result","archived":false,"fork":false,"pushed_at":"2023-06-29T16:03:52.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T08:47:57.911Z","etag":null,"topics":["elm","fold","loop","recursion","stoppable"],"latest_commit_sha":null,"homepage":"https://dark.elm.dmy.fr/packages/lue-bird/elm-partial-or-complete/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lue-bird.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":"contributing.md","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}},"created_at":"2023-04-29T14:32:25.000Z","updated_at":"2023-04-29T14:34:13.000Z","dependencies_parsed_at":"2024-10-26T21:56:08.221Z","dependency_job_id":"14241890-1938-4a5e-88a5-969b7b33e474","html_url":"https://github.com/lue-bird/elm-partial-or-complete","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-partial-or-complete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-partial-or-complete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-partial-or-complete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-partial-or-complete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lue-bird","download_url":"https://codeload.github.com/lue-bird/elm-partial-or-complete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246660077,"owners_count":20813338,"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","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":["elm","fold","loop","recursion","stoppable"],"created_at":"2024-10-26T21:31:17.468Z","updated_at":"2025-10-06T15:11:36.088Z","avatar_url":"https://github.com/lue-bird.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`PartialOrComplete`](PartialOrComplete)\n\n```elm\n| Partial partial -- keep going\n| Complete complete -- done\n```\n\n– a _pattern_ used in\n\n  - ```elm\n    type Step folded\n        = Continue folded\n        | Done folded\n    \n    stoppableFold :\n       folded\n    -\u003e (element -\u003e folded -\u003e Step folded)\n    -\u003e Structure element\n    -\u003e folded\n    ```\n      - [`List.Extra.stoppableFold`](https://dark.elm.dmy.fr/packages/elm-community/list-extra/latest/List-Extra#stoppableFold)\n      - [`FastDict.stoppableFold`](https://dark.elm.dmy.fr/packages/miniBill/elm-fast-dict/1.1.0/FastDict#stoppableFold)\n  - ```elm\n    type Step state complete\n        = Loop state\n        | Done complete\n    \n    loop :\n       state\n    -\u003e (state -\u003e Magic (Step state complete))\n    -\u003e Magic complete\n    ```\n      - [`Parser.loop`](https://dark.elm.dmy.fr/packages/elm/parser/latest/Parser#loop)\n      - [`Bytes.Decode.loop`](https://dark.elm.dmy.fr/packages/elm/bytes/1.0.8/Bytes-Decode#loop)\n      - [`Bytes.Parser.loop`](https://dark.elm.dmy.fr/packages/zwilias/elm-bytes-parser/1.0.0/Bytes-Parser#loop)\n      - [`Parser.Recoverable.loop`](https://dark.elm.dmy.fr/packages/the-sett/parser-recoverable/1.0.0/Parser-Recoverable#loop),\n      - [`State.tailRec(M)`](https://dark.elm.dmy.fr/packages/folkertdev/elm-state/latest/State#tailRec)\n  - ```elm\n    type Step\n        = InProgress InProgress\n        | Done Complete\n    \n    step : InProgress -\u003e Step\n    ```\n    step-by-step testing, benchmarking, parsing, simplifying/shrinking, evaluating, ...\n      - [`Trampoline.StepResult`](https://dark.elm.dmy.fr/packages/mgree/trampoline/latest/Trampoline#StepResult)\n\nMaybe it makes sense to have a shared type in a shared place?\nWith shared documentation and helpers?\n\n## where [`PartialOrComplete`](PartialOrComplete) is already being used\n\nStep through a structure; stop when you're done.\n\n  - [`List.Linear.foldUntilCompleteFrom`](https://dark.elm.dmy.fr/packages/lue-bird/elm-linear-direction/latest/List-Linear#foldUntilCompleteFrom)\n  - [`KeysSet.foldUntilCompleteFrom`](https://dark.elm.dmy.fr/packages/lue-bird/elm-keysset/latest/KeysSet#foldUntilCompleteFrom)\n\nSuggestions \u0026 additions welcome!\n\n## reasons for avoiding it\n\n  - You don't want to require users to manually install this package\n    for just the stoppable type and helpers?\n  \n  - In your domain, variant names can be more specific and descriptive\n    than \"partial\" and \"complete\"?\n\n  - You like avoiding package dependencies?\n    → You can expect this package to not have breaking changes\n\n  - You have the same intermediate and complete types and use\n    ```elm\n    type InProgress\n        = Atom { info : Info, report : Maybe Report }\n        | Structured (List InProgress)\n    \n    step : InProgress -\u003e InProgress\n    isDone : InProgress -\u003e Bool\n    ```\n    → I do suggest looking into\n    ```elm\n    type Thing report\n        = Atom { info : Info, report : report }\n        | Structured (List (Thing report))\n    \n    step : Thing (Maybe Report) -\u003e PartialOrComplete (Thing (Maybe Report)) (Thing Report)\n    ```\n    I'd say that's a tiny tiny bit nicer because you can't miss that you're already done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-partial-or-complete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flue-bird%2Felm-partial-or-complete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-partial-or-complete/lists"}