René's URL Explorer Experiment


Title: Design Meeting Notes, 5/19/2017 · Issue #15957 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 5/19/2017 · Issue #15957 · microsoft/TypeScript

X Title: Design Meeting Notes, 5/19/2017 · Issue #15957 · microsoft/TypeScript

Description: Inference/Generic function composition requests Issues linked to at the bottom. Why are we revisiting this? Ben from RxJS filed an issue about general inference difficulties. Will also be important for function pipeline in the future if ...

Open Graph Description: Inference/Generic function composition requests Issues linked to at the bottom. Why are we revisiting this? Ben from RxJS filed an issue about general inference difficulties. Will also be important...

X Description: Inference/Generic function composition requests Issues linked to at the bottom. Why are we revisiting this? Ben from RxJS filed an issue about general inference difficulties. Will also be important...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/15957

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 5/19/2017","articleBody":"# Inference/Generic function composition requests\r\n\r\nIssues linked to at the bottom.\r\n____________\r\n\r\n* Why are we revisiting this?\r\n    * Ben from RxJS filed an issue about general inference difficulties.\r\n    * Will also be important for function pipeline in the future if it lands in ES.\r\n* Currently we use inferences from *values* to flow into function parameters\r\n* But we *don't* use the type that the result will flow *into* for inferences.\r\n\r\nExample\r\n\r\n```ts\r\ntype Mapper\u003cT, U> = (x: T) => U;\r\n\r\nfunction wrap\u003cT, U>(cb: Mapper\u003cT, U>): Mapper\u003cT, U> {\r\n    return cb;\r\n}\r\n\r\nfunction wrapStringToNumber(cb: Mapper\u003cstring, number>): Mapper\u003cstring, number> {\r\n    return cb;\r\n}\r\n\r\n// works (not wrapped in a call)\r\nlet f1: Mapper\u003cstring, number> = s => s.length;\r\n\r\n// works (types are concrete)\r\nlet f2: Mapper\u003cstring, number> = wrapStringToNumber(s => s.length);\r\n\r\n// doesn't work because there are no parameters with known types\r\nlet f3: Mapper\u003cstring, number> = wrap(s => s.length);\r\n```\r\n\r\nWhat you'd like in the last example is that `wrap(...)` draws inferences from its contextual type.\r\n\r\nBut there are some problems with just using the contextual type.\r\n\r\n```ts\r\n// This works\r\nlet a1 = [\"a\", \"b\"].map(s => s.length);\r\n\r\n// This doesn't - requesting the contextual type of `map`'s argument \"fixes\"\r\n// its type parameters which don't have any inferences. This means that `s` gets the right type,\r\n// but `a2` gets the type `Array\u003c{}>`!\r\nlet a2 = [\"a\", \"b\"].map(wrap(s => s.length));\r\n```\r\n\r\nSo basic idea for solution.\r\n\r\n1. Draw inferences from arguments that are not contextually sensitive (e.g. values that are not untyped lambdas that we could give types to).\r\n2. During the *second round* of inference...\r\n    * if we run into a a contextually sensitive argument...\r\n    * which needs a type parameter which has no inferences...\r\n    * then reach out of the call and make inferences from the contextual type to the call's return type\r\n\r\nHarder stuff involves inference between generic type parameters.\r\nNot clear what to do here, but we can tackle it one step at a time.\r\n\r\n_______\r\n\r\n# Default imports for CommonJS modules\r\n\r\nWant to align with Babel's emit - very difficult when people transition to using TypeScript and have to change their imports.\r\n\r\nBiggest problem is that no way to tell which is \"more correct\" when you have a `.d.ts` that has top-level exports - is that a CJS or is it an ES module authored on top of CJS?\r\n\r\nEntire thing needs a proposal.\r\n_______\r\n\r\n## Issues for Composition (instantiate generic signatures using contextual type instead of any)\r\n\r\nOpen:\r\n\r\n* https://github.com/Microsoft/TypeScript/issues/9366\r\n\r\nDuplicates:\r\n\r\n* https://github.com/Microsoft/TypeScript/issues/417\r\n* https://github.com/Microsoft/TypeScript/issues/9107\r\n* https://github.com/Microsoft/TypeScript/issues/9949\r\n* https://github.com/Microsoft/TypeScript/issues/10247\r\n* https://github.com/Microsoft/TypeScript/issues/11311\r\n* https://github.com/Microsoft/TypeScript/issues/11343\r\n* https://github.com/Microsoft/TypeScript/issues/13570\r\n* https://github.com/Microsoft/TypeScript/issues/13632\r\n* https://github.com/Microsoft/TypeScript/issues/15016\r\n\r\n## Inference from return type position\r\n\r\n* https://github.com/Microsoft/TypeScript/issues/11152\r\n* https://github.com/Microsoft/TypeScript/issues/3423\r\n\r\n## Higher order inference with generic functions\r\n\r\n* https://github.com/Microsoft/TypeScript/issues/15680\r\n* https://github.com/Microsoft/TypeScript/issues/10247\r\n\r\n## Comparing generic signatures\r\n\r\nOpen:\r\n* https://github.com/Microsoft/TypeScript/issues/5616\r\n* https://github.com/Microsoft/TypeScript/issues/138\r\n\r\nDuplicates:\r\n\r\n* https://github.com/Microsoft/TypeScript/issues/3038\r\n* https://github.com/Microsoft/TypeScript/issues/3410\r\n* https://github.com/Microsoft/TypeScript/issues/3720\r\n* https://github.com/Microsoft/TypeScript/issues/5251\r\n* https://github.com/Microsoft/TypeScript/issues/8397\r\n* https://github.com/Microsoft/TypeScript/issues/8459\r\n* https://github.com/Microsoft/TypeScript/issues/11537\r\n* https://github.com/Microsoft/TypeScript/issues/11877\r\n* https://github.com/Microsoft/TypeScript/issues/13631\r\n* https://github.com/Microsoft/TypeScript/issues/15458\r\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2017-05-19T20:22:07Z","url":"https://github.com/microsoft/TypeScript/issues/15957"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:949d8b4f-854a-4a3d-7d26-62f0c2d2d983
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE8E2:2E5652:5FB4C5:7BC222:6B00DE63
html-safe-nonce5d26d71f434c7dafa40b9009386b2504584eb45bce68024a5b064cd0894ea43f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEUyOjJFNTY1Mjo1RkI0QzU6N0JDMjIyOjZCMDBERTYzIiwidmlzaXRvcl9pZCI6IjU0NDY3NDIzNDY3ODE3NDQ3MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6407c6bf3ea832514bd59b66e5fa68a33481d1809bebbe2f76a7d5b5411d96d0
hovercard-subject-tagissue:230080180
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/15957/issue_layout
twitter:imagehttps://opengraph.githubassets.com/52767e644da156c0ab56028f29bc24cd7c2f6e5d2fb3770e9ac32c5da5cc3c81/microsoft/TypeScript/issues/15957
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/52767e644da156c0ab56028f29bc24cd7c2f6e5d2fb3770e9ac32c5da5cc3c81/microsoft/TypeScript/issues/15957
og:image:altInference/Generic function composition requests Issues linked to at the bottom. Why are we revisiting this? Ben from RxJS filed an issue about general inference difficulties. Will also be important...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/15957#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F15957
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F15957
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/15957
Reloadhttps://github.com/microsoft/TypeScript/issues/15957
Reloadhttps://github.com/microsoft/TypeScript/issues/15957
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/15957
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/15957
Design Meeting Notes, 5/19/2017https://github.com/microsoft/TypeScript/issues/15957#top
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on May 19, 2017https://github.com/microsoft/TypeScript/issues/15957#issue-230080180
Supporting generic type inference over the other higher-order functions #9366https://github.com/microsoft/TypeScript/issues/9366
Higher order functions lose type parameters #417https://github.com/microsoft/TypeScript/issues/417
Generics not being inferred in complex case #9107https://github.com/microsoft/TypeScript/issues/9107
question: how can i create and return a generic function in TypeScript? #9949https://github.com/microsoft/TypeScript/issues/9949
Function composition challenge for type system #10247https://github.com/microsoft/TypeScript/issues/10247
any inferred as type parameter even with --noImplicitAny #11311https://github.com/microsoft/TypeScript/issues/11311
Wrong overload resolution with generics #11343https://github.com/microsoft/TypeScript/issues/11343
Overload resolution: Choosing the wrong overload when arguments involve generic wrappers #13570https://github.com/microsoft/TypeScript/issues/13570
noImplicitAny and generic arrow functions misbehave #13632https://github.com/microsoft/TypeScript/issues/13632
Improve type inference for generic curried functions #15016https://github.com/microsoft/TypeScript/issues/15016
Use return type as an inference location #11152https://github.com/microsoft/TypeScript/issues/11152
Suggestion: Enable inferring the result type of a generic function based on the context in which it is used #3423https://github.com/microsoft/TypeScript/issues/3423
Smarter type inference for functional programming (RxJS, Ramda, etc) #15680https://github.com/microsoft/TypeScript/issues/15680
Function composition challenge for type system #10247https://github.com/microsoft/TypeScript/issues/10247
Compiles without error when the return type signature of variable doesn't match that of the generic function that it is being assigned to #5616https://github.com/microsoft/TypeScript/issues/5616
Use contextual signature instantiation to compare signatures #138https://github.com/microsoft/TypeScript/issues/138
Inference bug #3038https://github.com/microsoft/TypeScript/issues/3038
Unexpected behavior of generic constraints #3410https://github.com/microsoft/TypeScript/issues/3410
generic constraint not working #3720https://github.com/microsoft/TypeScript/issues/3720
Generic methods are not properly inferred when used as a value #5251https://github.com/microsoft/TypeScript/issues/5251
Generic lambda identity function can cheat typesystem easily #8397https://github.com/microsoft/TypeScript/issues/8397
unsound type constraints #8459https://github.com/microsoft/TypeScript/issues/8459
Type inference for generic functions #11537https://github.com/microsoft/TypeScript/issues/11537
Compiler allows violation of a generic function type interface #11877https://github.com/microsoft/TypeScript/issues/11877
Generics return type check with arrow functions #13631https://github.com/microsoft/TypeScript/issues/13631
Generic type constraint ignored when applied to interface expecting a different signature. #15458https://github.com/microsoft/TypeScript/issues/15458
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
on May 19, 2017https://github.com/microsoft/TypeScript/issues/15957#event-1090160493
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on May 19, 2017https://github.com/microsoft/TypeScript/issues/15957#issuecomment-302808150
Function composition challenge for type system #10247 (comment)https://github.com/microsoft/TypeScript/issues/10247#issuecomment-266844059
Constraints cannot be proven in mapped types combination #13039 (comment)https://github.com/microsoft/TypeScript/issues/13039#issuecomment-268129526
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 30, 2017https://github.com/microsoft/TypeScript/issues/15957#event-1228405679
microsofthttps://github.com/microsoft
on Jun 14, 2018https://github.com/microsoft/TypeScript/issues/15957#event-1682152890
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/15957
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/15957
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.