{"action":"created","issue":{"url":"https://api.github.com/repos/gcanti/flow-runtime/issues/19","repository_url":"https://api.github.com/repos/gcanti/flow-runtime","labels_url":"https://api.github.com/repos/gcanti/flow-runtime/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/gcanti/flow-runtime/issues/19/comments","events_url":"https://api.github.com/repos/gcanti/flow-runtime/issues/19/events","html_url":"https://github.com/gcanti/flow-runtime/issues/19","id":188738635,"number":19,"title":"Project goals","user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-11T11:17:51Z","updated_at":"2016-11-14T13:13:27Z","closed_at":null,"body":"Hey, this is a cool project! I've been working on something really similar - I even called it `flow-runtime` until I saw you'd grabbed the name :). I was wondering what your goals for the project are? Do you intend to support all of flow's features such as type parameters, object indexers, functions etc or will you keep to a smaller subset?  I think there's tremendous value in having a canonical way to represent types in JS, the ecosystem really needs a project like this."},"comment":{"url":"https://api.github.com/repos/gcanti/flow-runtime/issues/comments/260331177","html_url":"https://github.com/gcanti/flow-runtime/issues/19#issuecomment-260331177","issue_url":"https://api.github.com/repos/gcanti/flow-runtime/issues/19","id":260331177,"user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T13:13:27Z","updated_at":"2016-11-14T13:13:27Z","body":"@gcanti I can't really see the difficulty with the example you provided - the lib already supports type parameters, e.g.\r\n \r\n```js\r\n  const demo = <T> (input: T): T => input;\r\n```\r\nCompiles to \r\n```\r\n  import t from \"flow-runtime\";\r\n  const demo = input => {\r\n    const T = t.typeParameter(\"T\");\r\n    let _inputType = T;\r\n    const _returnType = t.return(T);\r\n    t.param(\"input\", _inputType).assert(input);\r\n    return _returnType.assert(input);\r\n  };\r\n```\r\nThis might not be the most beautiful output in the world but it can match flow semantics. The type parameter instance captures the type it first receives and uses it for all subsequent checks. \r\n\r\nI think I understand where you're coming from, I'm the author of [babel-plugin-typecheck](/codemix/babel-plugin-typecheck) and I've run into many of the same headaches that you will have experienced with tcomb. It's why I'm so insistent that flow compatibility needs to be exact, because anything else makes the approach unusable. But it's definitely possible to achieve it, and I don't think doing so needs to bloat the library code itself (although obviously it would require some tooling around it)"}}
{"actor":{"display_login":"phpnode"}}