{"id":21207297,"url":"https://github.com/cacilhas/tree","last_synced_at":"2025-10-11T16:08:47.870Z","repository":{"id":119028785,"uuid":"188427365","full_name":"cacilhas/tree","owner":"cacilhas","description":"tree datatype according to http://homepages.inf.ed.ac.uk/stg/NOTES/node62.html","archived":false,"fork":false,"pushed_at":"2019-05-24T17:07:13.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-04T19:47:04.019Z","etag":null,"topics":["exercise","mlton","smackage","sml","standard-ml","tree-structure","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"Standard ML","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/cacilhas.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-24T13:34:10.000Z","updated_at":"2020-04-23T04:58:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3a7c108-059c-47c3-bc32-e850f9de3109","html_url":"https://github.com/cacilhas/tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cacilhas/tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cacilhas%2Ftree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cacilhas%2Ftree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cacilhas%2Ftree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cacilhas%2Ftree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cacilhas","download_url":"https://codeload.github.com/cacilhas/tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cacilhas%2Ftree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271747030,"owners_count":24813607,"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-08-23T02:00:09.327Z","response_time":69,"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":["exercise","mlton","smackage","sml","standard-ml","tree-structure","tutorial"],"created_at":"2024-11-20T20:58:22.049Z","updated_at":"2025-10-11T16:08:42.799Z","avatar_url":"https://github.com/cacilhas.png","language":"Standard ML","readme":"[license]: https://opensource.org/licenses/BSD-3-Clause\n[mlton]: http://mlton.org/\n[node62]: http://homepages.inf.ed.ac.uk/stg/NOTES/node62.html\n[pipelines]: https://github.com/cacilhas/pipelines\n[smackage]: http://www.elsman.com/lessons/2014/10/02/getting-started-with-smackage\n[sML]: http://mlton.org/SuccessorML\n[tutorial]: http://homepages.inf.ed.ac.uk/stg/NOTES/notes.html\n[unittestml]: https://github.com/cacilhas/UnitTestML\n\n# Tree\n\nThis lib provides the tree datatype according to the [node 62][node62] from the\nSchool of Informatics’ [Standard ML ’97 on-line tutorial][tutorial].\n\nDepends on [MLton][mlton] with [SuccessorML][sML].\n\n## Installing\n\nInstall [Smackage][smackage] and run:\n\n```sh\nsmackage source tree git https://github.com/cacilhas/tree.git\nsmackage refresh\nsmackage get tree\n```\n\n## Usage\n\nIn your MLBasis add the entry:\n\n```sml\n$(SMACKAGE)/tree/v1/tree.mlb\n```\n\n### API and Examples\n\nCreating a node:\n\n```sml\nval node = Tree.node(0, Tree.empty, Tree.empty)\n```\n\nThe `Tree.node` expects a 3-element tuple: the value, the left node, and the\nright node. `Tree.empty` is an empty node.\n\nThe *funs* that deals with nodes:\n\n- `Tree.depth : 'a tree -\u003e int` returns the tree depth\n- `Tree.size  : 'a tree -\u003e int` returns the size of the tree\n- `Tree.value : 'a tree -\u003e 'a option` returns the value bound to the node\n\n## Testing\n\nInstall [UnitTestML][unittestml] and [Pipelines][pipelines], and run:\n\n```sh\nmlton tests/test.mlb\n./tests/test\n```\n\n## License\n\n[The 3-Clause BSD License][license]\n\n```\nCopyright 2019 Rodrigo Cacilhas \u003cbatalema@cacilhas.info\u003e\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation and/or\nother materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcacilhas%2Ftree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcacilhas%2Ftree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcacilhas%2Ftree/lists"}