{"id":15092941,"url":"https://github.com/olaven/fun","last_synced_at":"2026-01-05T11:10:21.334Z","repository":{"id":57242837,"uuid":"262536239","full_name":"olaven/fun","owner":"olaven","description":"Util library for functional programming in Deno ","archived":false,"fork":false,"pushed_at":"2020-06-23T13:35:46.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T11:16:34.696Z","etag":null,"topics":["deno","functional-programming","library","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olaven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-09T09:31:25.000Z","updated_at":"2020-06-23T13:35:44.000Z","dependencies_parsed_at":"2022-09-15T04:53:12.958Z","dependency_job_id":null,"html_url":"https://github.com/olaven/fun","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/olaven%2Ffun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaven%2Ffun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaven%2Ffun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaven%2Ffun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olaven","download_url":"https://codeload.github.com/olaven/fun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952554,"owners_count":20537467,"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":["deno","functional-programming","library","typescript"],"created_at":"2024-09-25T11:01:55.016Z","updated_at":"2026-01-05T11:10:21.307Z","avatar_url":"https://github.com/olaven.png","language":"TypeScript","readme":"# Fun ![Test](https://github.com/olaven/fun/workflows/Test/badge.svg) [![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/raw.githubusercontent.com/olaven/fun/master/mod.ts) [![codebeat badge](https://codebeat.co/badges/7529200f-9cc1-4049-80f6-b3f4f06dfc4b)](https://codebeat.co/projects/github-com-olaven-fun-master)\nTiny utility library for functional programming in Deno/Deno   \n\n## About \nThis is a learning project I created because I wanted to understand some \nconcepts in functional programming. Use the library if you want, but keep \nin mind that it is not meant to be anything serious. \n\n## Getting started \nOne function is exported: `fun`. You pass a value to it. \nIn return, it gives you functions to apply to your value. \n\nThese functions are: \n`map`, `apply`, `run` and `get`. \n\n* `map` -\u003e transform to new type \n* `apply` -\u003e transform within same type \n* `run` -\u003e run arbitrary code \n* `get` -\u003e get your value back\n\nSee the example below: \n```typescript\n// Node \n// - npm install fun-node\nimport { fun } from \"fun-node\"\n// Deno \nimport { fun } from \"https://denopkg.com/olaven/fun\" \n\ninterface Person { name: string, salary: number }\nconst person: Person = { name: \"joe\", salary: 100 }; \n\nconst format_salary = (person: Person) =\u003e \n    fun(person)\n        .map(person =\u003e person.salary)\n        .map(salary =\u003e salary.toString())\n        .apply(salary =\u003e `${salary},-`)\n        .get();\n\n//prints 100,-\nconsole.log(format_salary(person));\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folaven%2Ffun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folaven%2Ffun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folaven%2Ffun/lists"}