{"id":15700992,"url":"https://github.com/zkat/fl-protocols","last_synced_at":"2025-05-12T15:23:27.452Z","repository":{"id":57170900,"uuid":"67480801","full_name":"zkat/fl-protocols","owner":"zkat","description":"fantasy-land specification bridge for @zkat/protocols","archived":false,"fork":false,"pushed_at":"2016-09-12T09:41:28.000Z","size":17,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T15:23:10.528Z","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-06T06:41:31.000Z","updated_at":"2025-04-15T15:12:45.000Z","dependencies_parsed_at":"2022-08-27T12:02:09.771Z","dependency_job_id":null,"html_url":"https://github.com/zkat/fl-protocols","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Ffl-protocols","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Ffl-protocols/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Ffl-protocols/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Ffl-protocols/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkat","download_url":"https://codeload.github.com/zkat/fl-protocols/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253764009,"owners_count":21960496,"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-10-03T19:57:42.993Z","updated_at":"2025-05-12T15:23:27.396Z","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`](npm.im/fantasy-land) compatibility\nlayer using [`protoduck`](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```\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%2Ffl-protocols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkat%2Ffl-protocols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Ffl-protocols/lists"}