{"id":23508719,"url":"https://github.com/lovasko/staf","last_synced_at":"2025-05-13T15:34:48.129Z","repository":{"id":56878975,"uuid":"76566172","full_name":"lovasko/staf","owner":"lovasko","description":"Statistics for Foldable containers","archived":false,"fork":false,"pushed_at":"2017-01-28T02:23:28.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T00:40:07.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasko.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}},"created_at":"2016-12-15T14:22:11.000Z","updated_at":"2016-12-19T04:53:36.000Z","dependencies_parsed_at":"2022-08-20T23:10:42.680Z","dependency_job_id":null,"html_url":"https://github.com/lovasko/staf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Fstaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Fstaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Fstaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Fstaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasko","download_url":"https://codeload.github.com/lovasko/staf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253970505,"owners_count":21992510,"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-12-25T11:31:43.923Z","updated_at":"2025-05-13T15:34:48.015Z","avatar_url":"https://github.com/lovasko.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/lovasko/staf.svg?branch=master)](https://travis-ci.org/lovasko/staf)\n[![Code Climate](https://codeclimate.com/github/lovasko/staf/badges/gpa.svg)](https://codeclimate.com/github/lovasko/staf)\n# Stats.Foldable\nA pure Haskell module that implements a safe interface to a set of statistical\ncomputations for all `Foldable` containers. Folding (i.e. _reducing_ or\n_crushing_) is a great fit for statistics, where a full data set has to be\nreduced to a single object that represents the set in a meaningful way.\n\n## Install\nThere are two standard ways of obtainig the module:\n * by cloning the GitHub repository: `git clone https://github.com/lovasko/staf`\n * by using the central Hackage server: `cabal install staf`\n\n## API\nAll `staf` functions use the `Maybe` type to represent a failure (e.g. an empty\ncontainer provided as the input). All numerical arguments are limited to the\nleast-assuming typeclass. The module exports the following 7 functions:\n\n#### Arithmetic mean\n```haskell\namean :: (F.Foldable f, Floating a)\n     =\u003e f a     -- ^ population\n     -\u003e Maybe a -- ^ arithmetic mean\n```\n\n#### Minimum\n```haskell\nmin :: (F.Foldable f, Ord a)\n    =\u003e f a     -- ^ population\n    -\u003e Maybe a -- ^ minimal value\n```\n\n#### Maximum\n```haskell\nmax :: (F.Foldable f, Ord a)\n    =\u003e f a     -- ^ population\n    -\u003e Maybe a -- ^ maximal value\n```\n\n#### Variance\n```haskell\nvar :: (F.Foldable f, Floating a)\n    =\u003e f a     -- ^ population\n    -\u003e Maybe a -- ^ variance\n```\n\n#### Standard deviation\n```haskell\nstddev :: (F.Foldable f, Floating a)\n       =\u003e f a     -- ^ population\n       -\u003e Maybe a -- ^ standard deviation\n```\n\n#### Covariance\n```haskell\ncovar :: (F.Foldable f, Floating a)\n      =\u003e f a     -- ^ first population\n      -\u003e f a     -- ^ second population\n      -\u003e Maybe a -- ^ covariance\n```\n\n#### Pearson correlation\n```haskell\ncorrel :: (F.Foldable f, Floating a)\n       =\u003e f a     -- ^ first population\n       -\u003e f a     -- ^ second population\n       -\u003e Maybe a -- ^ correlation\n```\n\n## Numerical stability\nThere is no current stability guarantee in any of the provided algorithms.\n\n## License\nThe `staf` module is licensed under the [2-clause BSD license](LICENSE). In\ncase that any other licensing is needed, feel free to contact the author.\n\n## Author\nDaniel Lovasko \u003cdaniel.lovasko@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Fstaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasko%2Fstaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Fstaf/lists"}