{"id":18636294,"url":"https://github.com/potocpav/typed-serialization","last_synced_at":"2026-07-22T17:05:55.622Z","repository":{"id":79854787,"uuid":"421729141","full_name":"potocpav/typed-serialization","owner":"potocpav","description":"Serialization withTtype Information","archived":false,"fork":false,"pushed_at":"2021-10-28T09:49:18.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T17:03:16.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/potocpav.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":"2021-10-27T08:04:02.000Z","updated_at":"2021-10-28T09:49:20.000Z","dependencies_parsed_at":"2023-07-04T13:22:11.655Z","dependency_job_id":null,"html_url":"https://github.com/potocpav/typed-serialization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/potocpav/typed-serialization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Ftyped-serialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Ftyped-serialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Ftyped-serialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Ftyped-serialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potocpav","download_url":"https://codeload.github.com/potocpav/typed-serialization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Ftyped-serialization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35770024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-11-07T05:29:01.185Z","updated_at":"2026-07-22T17:05:55.607Z","avatar_url":"https://github.com/potocpav.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typed Serialization\n\nThe [library itself is here](src/TypedSerialization.hs), and [example use-case is here](app/Main.hs).\n\nEverything can be run with `cabal run`.\n\nThis library allows us to defer type checking of expressions to run time. At run time, there is a separate \"type-checking\" step which validates the given expression before any data is processed. This gives us the guarantee that data processing itself can't fail, no matter the input.\n\nThis would be useful for value passing inside an algebra. Algebra needs a way to pass typed values around (green connections in the [Graph DSL proposal](https://scriveab.atlassian.net/wiki/spaces/EN/pages/3088646145/8+-+Graph+DSL)). TypedSerialization library allows us to work with values in validated graphs without worrying about any serialization failures.\n\nThis approach can be easily extended to also prove that values exist because they were set earlier in the flow. Haskell code then wouldn't need to [wrap values inside `Maybe`](https://github.com/scrive/kontrakcja/blob/master/backend/flow/src/Flow/Controller/Algebra.hs#L113-L118) and [use `fromJust` on them](https://github.com/scrive/kontrakcja/blob/master/backend/flow/src/Flow/Controller/Algebra.hs#L108-L109), as it currently does.\n\n## Unresolved Questions\n\n* Does this already exist somewhere?\n* Can we get rid of some of the type parameters? Using this library as-is, the algebra would gain another two type parameters. `Flow e c l k s t` doesn't look good.\n* Is there another way to transform types to values with `Eq`, perhaps supported by the compiler?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotocpav%2Ftyped-serialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotocpav%2Ftyped-serialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotocpav%2Ftyped-serialization/lists"}