{"id":20828812,"url":"https://github.com/perty/elm-impossible-state-transition","last_synced_at":"2026-03-14T22:40:52.634Z","repository":{"id":137743668,"uuid":"185766465","full_name":"perty/elm-impossible-state-transition","owner":"perty","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-10T09:46:38.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T18:40:25.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perty.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-05-09T09:15:06.000Z","updated_at":"2023-01-10T09:46:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6ad9485-0b7a-4377-b884-d3c6761dc4c8","html_url":"https://github.com/perty/elm-impossible-state-transition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perty%2Felm-impossible-state-transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perty%2Felm-impossible-state-transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perty%2Felm-impossible-state-transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perty%2Felm-impossible-state-transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perty","download_url":"https://codeload.github.com/perty/elm-impossible-state-transition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243179814,"owners_count":20249179,"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":[],"created_at":"2024-11-17T23:18:30.976Z","updated_at":"2025-12-26T22:56:22.763Z","avatar_url":"https://github.com/perty.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Make impossible state transitions impossible\n\nIn any sane language you can make impossible state impossible by correct modelling and catch mistakes at compile time already.\n\nBut what about state _transitions_? And in compile time? We had a discussion at Oslo Elm conference 2019. Then I wrote a suggested solution and posted it here [https://discourse.elm-lang.org/t/making-impossible-state-transitions-impossible-oslo-elm-day-question/3159](https://discourse.elm-lang.org/t/making-impossible-state-transitions-impossible-oslo-elm-day-question/3159).\n\nHere you find a model of an order tracking system. An order goes through different states but not all transitions are possible. The proof is in that `Main.elm` do not compile as it tries to break the rules of the state machine.\n\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Initial : init\n    Initial --\u003e Processing : process\n    Initial --\u003e Cancelled : cancelInital\n    Processing --\u003e Cancelled : cancelProcessing\n    Processing --\u003e Shipping: ship\n    Shipping --\u003e Shipped : shipped\n    Shipping --\u003e Lost : loose\n    Lost --\u003e [*]\n    Shipped --\u003e [*]\n```\n\nThis repository keeps the code. And 2023 I believe I should write a Readme too! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperty%2Felm-impossible-state-transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperty%2Felm-impossible-state-transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperty%2Felm-impossible-state-transition/lists"}