{"id":18319896,"url":"https://github.com/bitwalker/functools","last_synced_at":"2025-07-15T19:42:31.539Z","repository":{"id":6338011,"uuid":"7573887","full_name":"bitwalker/functools","owner":"bitwalker","description":"Functional programming tools for Go","archived":false,"fork":false,"pushed_at":"2013-01-13T11:50:39.000Z","size":144,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T08:20:55.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bitwalker.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}},"created_at":"2013-01-12T10:08:37.000Z","updated_at":"2015-10-15T12:20:32.000Z","dependencies_parsed_at":"2022-09-02T21:51:15.873Z","dependency_job_id":null,"html_url":"https://github.com/bitwalker/functools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwalker%2Ffunctools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwalker%2Ffunctools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwalker%2Ffunctools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwalker%2Ffunctools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitwalker","download_url":"https://codeload.github.com/bitwalker/functools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054275,"owners_count":21039968,"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-11-05T18:14:36.587Z","updated_at":"2025-04-09T14:23:29.816Z","avatar_url":"https://github.com/bitwalker.png","language":"Go","readme":"## functools\n\nFunctional programming tools for Go\n\n## About\n\nThis package provides you with the tools you need to perform high level manipulation of functions that you might be used to coming from other programming languages. Of particular note is the lack of an Apply function, for partially applying function arguments - which happens to be the first 'tool' I've added. Your best source for documentation is the source file itself, but I've broken down the basics below.\n\n## Current Features\n\n#### Functions\n\n**Apply**: Partial application of function arguments\n\n**ApplyMulti**: Apply for functions with multiple return values\n\n**Compose**: Takes functions `f` and `g`, and returns a new function `fg` whose signature is: `fg(x) = f(g(x))`\n\n**ToList**: Converts a slice to a LinkedList\n\n**ToSlice**: Converts a LinkedList to a slice\n\n**List**: Creates a new LinkedList\n\n**Cons**: Prepend a value to a LinkedList\n\n**Generate**: Create an infinite list given an initial value and a function that takes the previous value and generates the next one. For example, passing a function with the signature `f(x) =\u003e x * x` would create a list of values where each is the square of the element preceding it.\n\n**LinkedList**: A traditional linked list structure where each node of the list contains it's current value (Head) and a pointer to the next node in the list (Tail). This enables nifty things like infinite sequences, and lazy evaluation. Create one using `List`, or `Cons`.\n\nLinkedList currently supports the following methods:\n\n```\n// View the list as a string\nString() string\n\n// The length of the list\nLength() int\n\n// Maps a function to every element of the list\nMap(func(x Anything) Anything) *LinkedList\n\n// Reduces a list to a value by applying the \n// reducer to every element of the list.\nReduce(func(acc, x Anything) Anything) Anything \n\n// Take the first `x` elements of the list\nTake(x int)\n\n// Drop the first x elements of the list\nDrop(x int)\n```\n\n\n## Contributing\n\nIf you have other tools you think belong in this package, by all means fork the repo and send a pull request. I'd like to make this a one stop shop for functional programming needs in Go.\n\nRight now I'm looking for help making the library more robust and error-proof. Currently, things are pretty fragile with no input validation whatsoever.\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2013 Paul Schoenfelder\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwalker%2Ffunctools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwalker%2Ffunctools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwalker%2Ffunctools/lists"}