{"action":"created","issue":{"url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/204","repository_url":"https://api.github.com/repos/fantasyland/fantasy-land","labels_url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/204/comments","events_url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/204/events","html_url":"https://github.com/fantasyland/fantasy-land/issues/204","id":190974393,"number":204,"title":"Fantasy Land proposal process for ECMAScript","user":{"login":"JAForbes","id":2615540,"avatar_url":"https://avatars.githubusercontent.com/u/2615540?v=3","gravatar_id":"","url":"https://api.github.com/users/JAForbes","html_url":"https://github.com/JAForbes","followers_url":"https://api.github.com/users/JAForbes/followers","following_url":"https://api.github.com/users/JAForbes/following{/other_user}","gists_url":"https://api.github.com/users/JAForbes/gists{/gist_id}","starred_url":"https://api.github.com/users/JAForbes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JAForbes/subscriptions","organizations_url":"https://api.github.com/users/JAForbes/orgs","repos_url":"https://api.github.com/users/JAForbes/repos","events_url":"https://api.github.com/users/JAForbes/events{/privacy}","received_events_url":"https://api.github.com/users/JAForbes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-11-22T11:27:11Z","updated_at":"2016-11-23T13:58:14Z","closed_at":null,"body":"I'm proposing the fantasy-land community contributes more actively in the ECMAScript language design process.  There's been some discussion on gitter, and we have at least 1 proposal idea.\r\n\r\nI think it would be good to get a sense of what the process is, so if anyone has any suggestions please say so!\r\n\r\n@davidchambers suggested @michaelficarra as a potential ally.  I'd like to get @mindeavor's input as well with his experience proposing https://github.com/mindeavor/es-pipeline-operator\r\n\r\nA candidate for our first proposal is https://github.com/fantasyland/function-prototype-map suggested by @puffnfresh \r\n"},"comment":{"url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/comments/262519056","html_url":"https://github.com/fantasyland/fantasy-land/issues/204#issuecomment-262519056","issue_url":"https://api.github.com/repos/fantasyland/fantasy-land/issues/204","id":262519056,"user":{"login":"isiahmeadows","id":4483844,"avatar_url":"https://avatars.githubusercontent.com/u/4483844?v=3","gravatar_id":"","url":"https://api.github.com/users/isiahmeadows","html_url":"https://github.com/isiahmeadows","followers_url":"https://api.github.com/users/isiahmeadows/followers","following_url":"https://api.github.com/users/isiahmeadows/following{/other_user}","gists_url":"https://api.github.com/users/isiahmeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/isiahmeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isiahmeadows/subscriptions","organizations_url":"https://api.github.com/users/isiahmeadows/orgs","repos_url":"https://api.github.com/users/isiahmeadows/repos","events_url":"https://api.github.com/users/isiahmeadows/events{/privacy}","received_events_url":"https://api.github.com/users/isiahmeadows/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T13:58:14Z","updated_at":"2016-11-23T13:58:14Z","body":"Here's what I'm thinking:\r\n\r\n1. Standardize a basic set of protocols based on a subset of the basic algebras here. Let's not add the full package yet, but we can maybe round it out later:\r\n\r\n    - Setoid (`equals`)\r\n    - Semigroup (`concat`)\r\n    - Monoid (Semigroup + `empty`)\r\n    - Functor (`map`)\r\n    - Apply (Functor + `ap`)\r\n    - Applicative (Apply + `constructor.of`)\r\n    - Chain (Apply + `chain`)\r\n    - Monad (Applicative + Chain)\r\n    - Bifunctor (Functor + `bimap`)\r\n\r\n    (Why include so little? Consider Promises, iterables, etc.: it's much easier to flesh out known, commonly implemented semantics. Most Promise implementations were ES6-compatible from the start, for example.)\r\n\r\n2. Propose that several existing types implement these protocols:\r\n\r\n    - All primitive types (including boxed types) except `null`/`undefined` implement Setoid\r\n    - Objects implement nothing\r\n    - Functions implement Monad\r\n    - Symbols implement Monad and Setoid\r\n    - Arrays, TypedArrays, Maps, and Sets implement Monad, Monoid, and Setoid\r\n    - WeakMaps and WeakSets implement nothing\r\n    - %IteratorPrototype% implements Functor\r\n    - Promises implement Monad and Bifunctor (return on right)\r\n    - Proposal-wise: %AsyncIteratorPrototype% implements Functor, etc.\r\n\r\n    Note that `equals` on collections works recursively, and that `iterator.map(f)`'s return value's prototype is %IteratorPrototype%.\r\n\r\n3. Push for [the bind operator proposal](https://github.com/tc39/proposal-bind-operator) (or some other pipelining operator) to gain better traction and increased priority.\r\n\r\n4. Propose a few new classes:\r\n\r\n    - Option or Maybe, implements Thenable (with coercion, `undefined` error), Monad and Setoid (either one works)\r\n    - right-biased Either, implements Thenable (flipped, with coercion to right), Monad, Bifunctor, and Setoid\r\n    - return-biased Try, implements Thenable (with coercion), Monad, Bifunctor, and Setoid (for safer exception handling)\r\n\r\nWe should allow methods to accept arguments beyond what each protocol requires in the proposal itself, since some types with existing correct methods (like `Array` with `Array.of`, `array.concat`, etc.) accept more parameters than necessary.\r\n\r\nAs for polyfills for steps 2 and 4, I suspect it'd be extraordinarily straightforward to do. Promises will require a boilerplate object to prevent coercion with `map`/etc., but that's about the end of it. Note that the invariants of callbacks (e.g. matching prototypes for `map`) are checked, though, and failure is an immediate synchronous TypeError, or synchronous rejection in the case of Promises.\r\n\r\nNote that those that implement `Bifunctor` also implement `Thenable`, with the arguments in reverse order and with coercion (like what Promises do today).\r\n\r\n-------\r\n\r\nOh, and with these, JS might start feeling a little like a lighter, more dynamic Scala."}}
{"actor":{"display_login":"isiahmeadows"}}