{"id":16399257,"url":"https://github.com/klntsky/purescript-balanced-fold","last_synced_at":"2026-02-07T17:04:28.073Z","repository":{"id":81698663,"uuid":"178684829","full_name":"klntsky/purescript-balanced-fold","owner":"klntsky","description":"Folds a list of values, trying as much as possible to balance.","archived":false,"fork":false,"pushed_at":"2019-05-24T15:50:13.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-12T00:06:16.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PureScript","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/klntsky.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-03-31T12:26:25.000Z","updated_at":"2019-05-24T15:50:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4c29745-6a22-412a-a192-1c9b514bc119","html_url":"https://github.com/klntsky/purescript-balanced-fold","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/klntsky/purescript-balanced-fold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klntsky%2Fpurescript-balanced-fold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klntsky%2Fpurescript-balanced-fold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klntsky%2Fpurescript-balanced-fold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klntsky%2Fpurescript-balanced-fold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klntsky","download_url":"https://codeload.github.com/klntsky/purescript-balanced-fold/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klntsky%2Fpurescript-balanced-fold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29200843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T16:28:23.579Z","status":"ssl_error","status_checked_at":"2026-02-07T16:28:22.566Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-10-11T05:23:29.994Z","updated_at":"2026-02-07T17:04:28.054Z","avatar_url":"https://github.com/klntsky.png","language":"PureScript","readme":"# purescript-balanced-fold [![Dependencies](https://img.shields.io/librariesio/github/klntsky/purescript-balanced-fold.svg)](https://libraries.io/github/klntsky/purescript-balanced-fold) [![Build status](https://travis-ci.org/klntsky/purescript-balanced-fold.svg?branch=master)](https://travis-ci.org/klntsky/purescript-balanced-fold)\n\n\nA balanced fold, also called tree fold, is an operation of folding a list of values using some associative operation, trying as much as possible to balance.\n\nCan be useful for constructing balanced binary trees, or more stable summation.\n\n# Example\n\nGiven a binary tree,\n\n```purescript\ndata T a = Empty | L a | B (T a) (T a)\n\ninfixl 6 B as :*:\n```\n\nwhich is an instance of `Semigroup` with `append = B` and `Monoid` with `mempty = Empty`,\n\n```purescript\nbalancedFold (map L (1..5)) ≡ ((L 1) :*: (((L 2) :*: (L 3)) :*: ((L 4) :*: (L 5))))\n```\n\nCheck out [the tests](test/TestMain.purs) for more examples.\n\n# See also:\n\n1. [treefold](http://hackage.haskell.org/package/treefold) on Hackage.\n\n# Module documentation\n\nBrowse [generated-docs](generated-docs/Data/BalancedFold.md).\n\nPM me if you want this library to be on Pursuit.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklntsky%2Fpurescript-balanced-fold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklntsky%2Fpurescript-balanced-fold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklntsky%2Fpurescript-balanced-fold/lists"}