{"id":21064043,"url":"https://github.com/luochen1990/coffee-mate","last_synced_at":"2025-05-16T02:32:22.229Z","repository":{"id":16520324,"uuid":"19273450","full_name":"luochen1990/coffee-mate","owner":"luochen1990","description":"library for functional programming via coffeescript, lightweight  \u0026 convenient","archived":false,"fork":false,"pushed_at":"2017-12-20T08:42:58.000Z","size":905,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T18:52:48.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luochen1990.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":"2014-04-29T11:00:34.000Z","updated_at":"2017-11-08T06:12:19.000Z","dependencies_parsed_at":"2022-09-10T09:12:14.260Z","dependency_job_id":null,"html_url":"https://github.com/luochen1990/coffee-mate","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fcoffee-mate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fcoffee-mate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fcoffee-mate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fcoffee-mate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luochen1990","download_url":"https://codeload.github.com/luochen1990/coffee-mate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254456065,"owners_count":22074090,"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-19T17:48:07.273Z","updated_at":"2025-05-16T02:32:18.765Z","avatar_url":"https://github.com/luochen1990.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"CoffeeMate\n==========\n\nHaving CoffeeScript for **Functional Programming** is cool, and it will be much better with this **CoffeeMate**, which provides a lot of properties(which should be implemented by a library rather than the CS-compiler) for CSers, includes:\n\n- [log macro](http://luochen1990.me/try_coffee?code=%22log%20-%3E%20%27hello%2C%20coffee-mate!%27%5Cn%5Cna%20%3D%201%5Cnb%20%3D%202%5Cnlog%20-%3E%20a%20%2B%20b%5Cn%5Cnls%20%3D%20%5B0..100%5D%5Cnlog%20-%3E%20sum(ls)%22)\n- [assert macro](http://luochen1990.me/try_coffee?code=%22a%20%3D%201%5Cnb%20%3D%202%5Cnassert%20-%3E%20a%20%3C%20b%5Cnassert%20-%3E%20a%20%3D%3D%20b%5Cn%22)\n- [dict comprehension](http://luochen1990.me/try_coffee?code=%22squared%20%3D%20dict(%5Bi%2C%20i%20*%20i%5D%20for%20i%20in%20%5B1..5%5D)%5Cnlog%20-%3E%20json%20squared%5Cn%5Cnchars%20%3D%20dict(%5Bi%2C%20chr(ord(%27a%27)%20%2B%20i)%5D%20for%20i%20in%20%5B0...26%5D)%5Cnlog%20-%3E%20json%20chars%22)\n- [nested list comprehensions](http://luochen1990.me/try_coffee?code=%22ls1%20%3D%20%5B1%2C%202%2C%203%5D%5Cnls2%20%3D%20%5B%27a%27%2C%20%27b%27%5D%5Cnr1%20%3D%20(%5C%22%23%7Bn%7D%23%7Bc%7D%5C%22%20for%20%5Bn%2C%20c%5D%20in%20list%20cartProd%20ls1%2C%20ls2)%5Cnlog%20-%3E%20json%20r1%5Cn%5Cn%23without%20cartProd%2C%20you%20chould%20only%20got%20this%3A%5Cnr2%20%3D%20(%5C%22%23%7Bn%7D%23%7Bc%7D%5C%22%20for%20n%20in%20ls1%20for%20c%20in%20ls2)%5Cnlog%20-%3E%20json%20r2%22)\n- [copy \u0026 deepcopy](http://luochen1990.me/try_coffee?code=%22a%20%3D%20%5B1%2C%201%2C%20%7Bx%3A%201%2C%20y%3A%201%7D%5D%5Cnb%20%3D%20deepcopy%20a%5Cnc%20%3D%20copy%20a%5Cn%5Cnb.first%20%3D%202%5Cnlog%20-%3E%20json%20b%5Cnlog%20-%3E%20json%20a%20%23a%20will%20not%20be%20changed%20since%20we%20are%20modifing%20b%20which%20is%20a%20copy%20of%20a%5Cn%5Cnb.third.x%20%3D%202%5Cnlog%20-%3E%20json%20b%5Cnlog%20-%3E%20json%20a%20%23a.third%20will%20not%20be%20changed%20since%20we%20are%20modifing%20b.third%20which%20is%20a%20copy%20of%20a.third%5Cn%5Cnc.third.x%20%3D%202%5Cnlog%20-%3E%20json%20c%5Cnlog%20-%3E%20json%20a%20%23a.third%20will%20be%20changed%20since%20we%20are%20modifing%20c.third%20which%20is%20eq%20(the%20same%20one)%20of%20a.third%22)\n- [lazy evaluation]()\n- [type convertions]()\n- [string formating]()\n- [pseudo-random]()\n- [classic js object reinforcement]()\n- [funny \u0026 useful high-order functions for FPers.]()\n\nAPI list\n--------\n\nHere lists all APIs provided, **click it to see demo**. you can also read [API description](API_description.md) for more details.\n\n- useful utils:\n\t[`log`]( http://luochen1990.me/try_coffee?code=%22log%20-%3E%201%20%2B%201%5Cnlog%20-%3E%20json%20list%20range(10)%5Cnlog%20-%3E%20json%20list%20take(10)%20prime_number()%5Cn%5Cna%20%3D%201%5Cnb%20%3D%202%5Cnlog.info%20-%3E%20a%20%2B%20b%22 ),\n\t[`assert`](http://luochen1990.me/try_coffee?code=%22a%20%3D%201%5Cnb%20%3D%20sum(0%2C%201)%5Cnassert%20-%3E%20a%20!%3D%20b%22),\n\t[`dict`](),\n\t[`copy`](),\n\t[`deepcopy`](),\n\t[`securely`](),\n\n- type convertors:\n\t[`int`](),\n\t[`float`](),\n\t[`bool`](),\n\t[`str`](),\n\t[`hex`](),\n\t[`ord`](),\n\t[`chr`](),\n\t[`json`](),\n\t[`obj`](),\n\n- url helpers:\n\t[`uri_encoder`](),\n\t[`uri_decoder`](),\n\n- lazy evaluation:\n\t[here](https://github.com/luochen1990/lazy.coffee/blob/master/APIs.md)\n\n- funny functions:\n\t[`church`](),\n\t[`Y`](),\n\t[`memoize`](),\n\n- basic functions:\n\t[`flip`](),\n\t[`seek`](),\n\t[`pluck`](),\n\t[`abs`](),\n\t[`floor`](),\n\t[`ceil`](),\n\t[`sum`](),\n\t[`max`](),\n\t[`min`](),\n\t[`max_index`](),\n\t[`min_index`](),\n\t[`next_permutation`](),\n\n- reinforce String:\n\t[`a_string.format`](),\n\t[`a_string.repeat`](),\n\n- reinforce Array:\n\t[`an_array.first`](),\n\t[`an_array.second`](),\n\t[`an_array.third`](),\n\t[`an_array.last`](),\n\n- reinforce Object:\n\t[`Object.size`](),\n\t[`Object.extend`](),\n\t[`Object.update`](),\n\nInstall\n-------\n\n#### for nodejs\n\n1. install with npm: `your-repo/\u003e npm install coffee-mate --save`\n2. require separately or globally:\n\t- require separately: `{log, assert, dict} = require 'coffee-mate'`\n\t- require globally: `require 'coffee-mate/global'`\n\n#### for browsers\n\n```html\n\u003cscript src=\"http://rawgit.com/luochen1990/coffee-mate/master/build/global.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nRun Demo (nodejs)\n-----------------\n\nrun `coffee ./demo.coffee` under directory `coffee-mate/` directly after you have `coffee-script` installed.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fcoffee-mate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluochen1990%2Fcoffee-mate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fcoffee-mate/lists"}