{"id":21155180,"url":"https://github.com/acorrenson/pym-s","last_synced_at":"2026-04-18T01:34:39.501Z","repository":{"id":68598879,"uuid":"202647800","full_name":"acorrenson/Pym-s","owner":"acorrenson","description":"Python with a sweet functionnal taste","archived":false,"fork":false,"pushed_at":"2020-01-11T13:26:04.000Z","size":376,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T15:15:24.447Z","etag":null,"topics":["functional-programming","ocaml","python","transpiler","typedef"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/acorrenson.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}},"created_at":"2019-08-16T02:55:44.000Z","updated_at":"2020-04-26T02:43:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0922a4a-e356-4e22-a02c-c71b3921651b","html_url":"https://github.com/acorrenson/Pym-s","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/acorrenson/Pym-s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorrenson%2FPym-s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorrenson%2FPym-s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorrenson%2FPym-s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorrenson%2FPym-s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acorrenson","download_url":"https://codeload.github.com/acorrenson/Pym-s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acorrenson%2FPym-s/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266465062,"owners_count":23933053,"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-22T02:00:09.085Z","response_time":66,"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":["functional-programming","ocaml","python","transpiler","typedef"],"created_at":"2024-11-20T11:16:27.541Z","updated_at":"2026-04-18T01:34:34.467Z","avatar_url":"https://github.com/acorrenson.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pym-s\n\n\u003e Python with a sweet functionnal taste\n\nPyms is a transpiler. It produces clean and reliable python modules from OCaml-like type definitions. Pym-s is mainly designed to make symbolic manipulations easier and safer in python3.\n\nPython modules generated with Pym-s are annotated according to the [PEP 484](https://www.python.org/dev/peps/pep-0484/) making them well suited for use with modern linters or type checkers such as [pyre](https://pyre-check.org/). Future versions of Pym-s will also include an option to generate dynamic type verification.\n\n**Example** :\n\n```python\n# bintree.pyms\n\ntypedef binary_tree =\n  | Node of int * binary_tree * binary_tree\n  | Leaf of int\n```\n\n```python\n# main.py\n\nfrom bintree import *\n\ndef count_leafs(bt : binary_tree):\n  if isinstance(bt, Leaf):\n    return 1\n  else:\n    _, child1, child2 = bt\n    return count_leafs(child1) + count_leafs(child2)\n\n# outputs 2\nprint(count_leafs(Node(0, Leaf(1), Leaf(2))))\n```\n\nThe preceding exemple need to be compiled down to pure python prior to execution :\n\n```\n$ pyms -i bintree.pyms -o bintree.py\n$ python3 main.py\n```\n\n# Install\n\nInstalling Pyms requires opam and a working ocaml environnement. While waiting for Pyms to be published on Opam, it is still possible to install it easily.\n\nTo install ocaml and opam, please visit [this link](https://ocaml.org/docs/install.html)\n\n\n## If you just have opam installed :\n\n```\ngit clone git@github.com:jdrprod/Pym-s.git\ncd Pym-s\nopam pin .\nopam install .\n```\n\n## If you already use dune :\n\n```\ngit clone git@github.com:jdrprod/Pym-s.git\ncd Pym-s\ndune build @install\ndune install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facorrenson%2Fpym-s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facorrenson%2Fpym-s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facorrenson%2Fpym-s/lists"}