{"id":15996419,"url":"https://github.com/zkat/protoduck-fl","last_synced_at":"2025-08-18T05:16:28.149Z","repository":{"id":65474327,"uuid":"67997585","full_name":"zkat/protoduck-fl","owner":"zkat","description":"fantasy-land specification bridge for protoduck","archived":false,"fork":false,"pushed_at":"2016-12-13T23:24:10.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-06T04:52:22.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/zkat.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":"2016-09-12T09:57:31.000Z","updated_at":"2025-06-11T12:14:10.000Z","dependencies_parsed_at":"2023-01-25T03:55:11.666Z","dependency_job_id":null,"html_url":"https://github.com/zkat/protoduck-fl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/zkat/protoduck-fl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fprotoduck-fl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fprotoduck-fl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fprotoduck-fl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fprotoduck-fl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkat","download_url":"https://codeload.github.com/zkat/protoduck-fl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fprotoduck-fl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270946093,"owners_count":24672894,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-08T07:42:17.639Z","updated_at":"2025-08-18T05:16:28.108Z","avatar_url":"https://github.com/zkat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fantasyland Protocols\n\nThis module provides a\n[`fantasy-land`](https://npm.im/fantasy-land) compatibility\nlayer using [`protoduck`](https://npm.im/protoduck). The compatibility\nlayer includes protocol definitions for all protocols with methods listed in the\n`fantasy-land` spec, and includes automatic two-way compatibility between\nmethods defined in either world.\n\nThat is: you can use protocol functions exported by `protoduck-fl` on any\nobject(s) that have `fantasy-land` methods implemented, without any extra work,\nand and methods you define using `protoduck-fl` will automatically become\navailable to `fantasy-land` users even if they are not directly using\n`protoduck-fl`.\n\nEven multiple-dispatched protocols will work two-ways, so `protoduck-fl` is a\ngreat way to augment your `fantasy-land` implementations!\n\n## Example\n\n```javascript\n// Basic two-way compatibility\n\u003e var Monoid = require('protoduck-fl/monoid')\n\u003e var fl = require('fantasy-land')\n\n\u003e Monoid(Number, { empty: () =\u003e 0 })\n\n\u003e (1)[fl.empty]()\n0\n\u003e var obj = { [fl.empty]: () =\u003e ({}) }\n[object Object]\n\u003e Monoid.empty(obj)\n{}\n\n// Multiple dispatch on fl methods\n\u003e var Setoid = require('protoduck-fl/setoid')\n\u003e Setoid(Number, [Number], {\n    equals: (n) =\u003e +this === n\n  })\n\u003e Setoid(Number, [String], {\n    equals: (s) =\u003e +this === parseFloat(s)\n  })\n\u003e Setoid(String, [Number], {\n    equals: (n) =\u003e parseFloat(''+this) === n\n  })\n\u003e (10)[fl.equals](\"10\")\n\u003e (5)[fl.equals](\"5\")\ntrue\n\u003e (\"1\")[fl.equals](1)\ntrue\n\u003e Setoid.equals(\"1\", 1)\ntrue\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fprotoduck-fl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkat%2Fprotoduck-fl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fprotoduck-fl/lists"}