{"action":"created","issue":{"url":"https://api.github.com/repos/sinelaw/sjs/issues/1","labels_url":"https://api.github.com/repos/sinelaw/sjs/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sinelaw/sjs/issues/1/comments","events_url":"https://api.github.com/repos/sinelaw/sjs/issues/1/events","html_url":"https://github.com/sinelaw/sjs/issues/1","id":54941527,"number":1,"title":"Installation instructions","user":{"login":"Raynos","id":479538,"avatar_url":"https://avatars.githubusercontent.com/u/479538?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynos","html_url":"https://github.com/Raynos","followers_url":"https://api.github.com/users/Raynos/followers","following_url":"https://api.github.com/users/Raynos/following{/other_user}","gists_url":"https://api.github.com/users/Raynos/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynos/subscriptions","organizations_url":"https://api.github.com/users/Raynos/orgs","repos_url":"https://api.github.com/users/Raynos/repos","events_url":"https://api.github.com/users/Raynos/events{/privacy}","received_events_url":"https://api.github.com/users/Raynos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-20T21:21:12Z","updated_at":"2015-01-21T08:52:25Z","closed_at":null,"body":"how do I use it?\r\n\r\nCan we have instructions for installation. ( I know nothing of Haskell )\r\n\r\nCan we have instructions for usage ? Does it just take js on stdin and outputs type inference data on stdout ?"},"comment":{"url":"https://api.github.com/repos/sinelaw/sjs/issues/comments/70803324","html_url":"https://github.com/sinelaw/sjs/issues/1#issuecomment-70803324","issue_url":"https://api.github.com/repos/sinelaw/sjs/issues/1","id":70803324,"user":{"login":"sinelaw","id":84020,"avatar_url":"https://avatars.githubusercontent.com/u/84020?v=3","gravatar_id":"","url":"https://api.github.com/users/sinelaw","html_url":"https://github.com/sinelaw","followers_url":"https://api.github.com/users/sinelaw/followers","following_url":"https://api.github.com/users/sinelaw/following{/other_user}","gists_url":"https://api.github.com/users/sinelaw/gists{/gist_id}","starred_url":"https://api.github.com/users/sinelaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinelaw/subscriptions","organizations_url":"https://api.github.com/users/sinelaw/orgs","repos_url":"https://api.github.com/users/sinelaw/repos","events_url":"https://api.github.com/users/sinelaw/events{/privacy}","received_events_url":"https://api.github.com/users/sinelaw/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T08:52:25Z","updated_at":"2015-01-21T08:52:25Z","body":"`sjs` takes any number of .js files and type-checks them together, in order (symbols defined in one file can be used in any file after it, but not the other way around).\r\n\r\nKeep in mind that the **output is hardly readable** right now. It will print for every line of JS a whole bunch of types, some of which belong to future lines. You need to sort of dig around to find the correct one. For example:\r\n\r\n//(this: a -> TNumber)                   <-- the actual type of function 'f'\r\n//TNumber                                <-- junk - actually refers to 'var x' below\r\n//[TNumber]                              <-- junk - internal stuff\r\n//                 TNumber               <-- the type of 'x' inside the function below\r\n//                     TNumber           <-- the type of '1' \r\n//                        TNumber        <-- junk, internal\r\n//                        [TNumber]      <-- junk, internal\r\n//                               TNumber <-- type of 'x' below\r\nfunction f() { var x = 1; return x; }\r\n//(this: b -> TNumber)                   <-- the type of 'f'\r\n//TNumber                                <-- junk - actually refers to 'var x' below\r\nf;\r\n//  TNumber                              <-- type of 'x'\r\n//      TNumber                          <-- type of '2'\r\nvar x = 2;\r\n//TNumber                                <-- type of 'x'\r\nx;\r\n\r\nWhen enough core features are completed, I'll fix the output as well.\r\n"}}