René's URL Explorer Experiment


Title: Suggestion: sum types / tagged union · Issue #186 · microsoft/TypeScript · GitHub

Open Graph Title: Suggestion: sum types / tagged union · Issue #186 · microsoft/TypeScript

X Title: Suggestion: sum types / tagged union · Issue #186 · microsoft/TypeScript

Description: A very nice addition to TypeScript's type system would be sum types in the spirit of ML-like languages. This is one of basic and simple programming constructs from functional programming which you really miss once you get used to it, but...

Open Graph Description: A very nice addition to TypeScript's type system would be sum types in the spirit of ML-like languages. This is one of basic and simple programming constructs from functional programming which you ...

X Description: A very nice addition to TypeScript's type system would be sum types in the spirit of ML-like languages. This is one of basic and simple programming constructs from functional programming which ...

Mail addresses
notifications@github.com

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: sum types / tagged union","articleBody":"A very nice addition to TypeScript's type system would be sum types in the spirit of ML-like languages.  This is one of basic and simple programming constructs from functional programming which you really miss once you get used to it, but which seem to have a hard time being included in new modern languages (contrary to other features from functional programming such as first-class functions, structural types, generics).\n\nI guess the most natural way to integrate sum types in the current language syntax would be to extend enum variants with extra parameters (similarly to what Rust does:  http://doc.rust-lang.org/tutorial.html#enums ) and upgrade the switch statement to a more powerful structural pattern matching (although in a first step, simply discriminating on the toplevel variant and capturing its parameters would be already quite good).\n\nThis is quite different from other the proposal about \"union types\"  (#14), which would mostly be useful to capture types in existing Javascript APIs.  Sum types are rather used to describe algebraic data structures. They would be particularly useful for any kind of symbolic processing (including for implementing the TypeScript compiler).\n","author":{"url":"https://github.com/alainfrisch","@type":"Person","name":"alainfrisch"},"datePublished":"2014-07-22T09:07:22Z","url":"https://github.com/microsoft/TypeScript/issues/186"}

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:03a18078-0a58-a65e-04fd-0c1128630aa1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD306:23A9CB:40EB16:57C87D:6AFBEC67
html-safe-nonce34eead89bf02e1680f501488dd631da75ea1bec878ffbfac3096e0dc84c12747
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzA2OjIzQTlDQjo0MEVCMTY6NTdDODdEOjZBRkJFQzY3IiwidmlzaXRvcl9pZCI6Ijg4NDM4NTAzNDE2MjAxMTY1ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac685a7309455292518d31a8d12da0185ac25778b61742d2eb58843b3c5b63b6b6
hovercard-subject-tagissue:38381463
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/186/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0c30405ad03cde1bbe22dd943d16a19307dcdeaecca6c02e31f2d6d7de3cdf2c/microsoft/TypeScript/issues/186
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0c30405ad03cde1bbe22dd943d16a19307dcdeaecca6c02e31f2d6d7de3cdf2c/microsoft/TypeScript/issues/186
og:image:altA very nice addition to TypeScript's type system would be sum types in the spirit of ML-like languages. This is one of basic and simple programming constructs from functional programming which you ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealainfrisch
hostnamegithub.com
expected-hostnamegithub.com
None744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec
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
releasedf859c48a4c8b4c0009c19bb4e82101aacb4b998
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/186#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F186
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%2F186
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/186
Reloadhttps://github.com/microsoft/TypeScript/issues/186
Reloadhttps://github.com/microsoft/TypeScript/issues/186
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests335 (335)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/pulse
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/186
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/186
Suggestion: sum types / tagged unionhttps://github.com/microsoft/TypeScript/issues/186#top
https://github.com/ahejlsberg
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
https://github.com/alainfrisch
Alain Frisch (alainfrisch)https://github.com/alainfrisch
on Jul 22, 2014https://github.com/microsoft/TypeScript/issues/186#issue-38381463
http://doc.rust-lang.org/tutorial.html#enumshttp://doc.rust-lang.org/tutorial.html#enums
#14https://github.com/microsoft/TypeScript/issues/14
Nexthttps://github.com/microsoft/TypeScript/issues/186?timeline_page=1
https://github.com/fdecampredon
François de Campredon (fdecampredon)https://github.com/fdecampredon
on Jul 22, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-49737488
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs Proposalhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on Jul 22, 2014https://github.com/microsoft/TypeScript/issues/186#event-144264592
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 22, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-49766787
https://github.com/fdecampredon
François de Campredon (fdecampredon)https://github.com/fdecampredon
on Jul 22, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-49778371
https://github.com/iislucas
iislucas (iislucas)https://github.com/iislucas
on Jul 23, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-49823050
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 28, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50410846
#14https://github.com/microsoft/TypeScript/issues/14
https://github.com/fdecampredon
François de Campredon (fdecampredon)https://github.com/fdecampredon
on Jul 29, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50504492
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/iislucas
iislucas (iislucas)https://github.com/iislucas
on Jul 29, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50507545
https://github.com/fsoikin
Fyodor Soikin (fsoikin)https://github.com/fsoikin
on Jul 29, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50507877
https://github.com/danquirk
Dan Quirk (danquirk)https://github.com/danquirk
on Jul 29, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50518597
https://github.com/alainfrisch
Alain Frisch (alainfrisch)https://github.com/alainfrisch
on Jul 30, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-50574540
Dan Quirk (@danquirk)https://github.com/danquirk
François de Campredon (@fdecampredon)https://github.com/fdecampredon
https://github.com/alainfrisch
Alain Frisch (alainfrisch)https://github.com/alainfrisch
on Sep 9, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-54993927
https://github.com/iislucas
iislucas (iislucas)https://github.com/iislucas
on Sep 9, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-54996318
Alain Frisch (@alainfrisch)https://github.com/alainfrisch
https://github.com/beloglazov
Anton Beloglazov (beloglazov)https://github.com/beloglazov
on Sep 10, 2014https://github.com/microsoft/TypeScript/issues/186#issuecomment-55117608
https://github.com/Artazor
Anatoly Ressin (Artazor)https://github.com/Artazor
on Jan 21, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-173719173
Dan Quirk (@danquirk)https://github.com/danquirk
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Jan 21, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-173746972
Anatoly Ressin (@Artazor)https://github.com/Artazor
investigationhttps://github.com/Microsoft/TypeScript/pull/6062
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Jan 21, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-173750021
Anatoly Ressin (@Artazor)https://github.com/Artazor
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Mar 15, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-197058404
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Mar 15, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-197070489
Anatoly Ressin (@Artazor)https://github.com/Artazor
#186 (comment)https://github.com/microsoft/TypeScript/issues/186#issuecomment-173719173
http://flowtype.org/docs/disjoint-unions.html#http://flowtype.org/docs/disjoint-unions.html#
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Mar 16, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-197094414
Basarat Ali Syed (@basarat)https://github.com/basarat
#6062https://github.com/microsoft/TypeScript/pull/6062
Anatoly Ressin (@Artazor)https://github.com/Artazor
https://github.com/Artazor'shttps://github.com/Artazor's
#186https://github.com/microsoft/TypeScript/issues/186
#186 (comment)https://github.com/microsoft/TypeScript/issues/186#issuecomment-173719173
http://flowtype.org/docs/disjoint-unions.html#http://flowtype.org/docs/disjoint-unions.html#
#186 (comment)https://github.com/microsoft/TypeScript/issues/186#issuecomment-197070489
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Jun 14, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-226028526
#9163https://github.com/microsoft/TypeScript/pull/9163
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
on Jun 15, 2016https://github.com/microsoft/TypeScript/issues/186#event-692629093
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on Jun 15, 2016https://github.com/microsoft/TypeScript/issues/186#event-692629163
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Jun 15, 2016https://github.com/microsoft/TypeScript/issues/186#event-692629184
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 17, 2016https://github.com/microsoft/TypeScript/issues/186#event-696492070
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Jun 17, 2016https://github.com/microsoft/TypeScript/issues/186#event-696492121
https://github.com/shelby3
shelby3https://github.com/shelby3
on Sep 10, 2016https://github.com/microsoft/TypeScript/issues/186#issuecomment-246087546
Aleksey-Bykovhttps://github.com/Aleksey-Bykov
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-68818764
abstract class instead of interfacehttps://github.com/Microsoft/TypeScript/issues/1007#issuecomment-246085962
Dan Quirk (@danquirk)https://github.com/danquirk
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-68818961
#1007https://github.com/microsoft/TypeScript/issues/1007
appears to me to be undesirablehttps://github.com/Microsoft/TypeScript/issues/1007#issuecomment-246085962
Mike Stay (@metaweta)https://github.com/metaweta
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-67721221
Andy Hanson (@andy-hanson)https://github.com/andy-hanson
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-171174165
Yegor Roganov (@roganov)https://github.com/roganov
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-170492714
Andy Hanson (@andy-hanson)https://github.com/andy-hanson
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-170294078
Ivo Gabe de Wolff (@ivogabe)https://github.com/ivogabe
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-170286495
Andy Hanson (@andy-hanson)https://github.com/andy-hanson
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-170283836
formalize nominal class subtypinghttps://github.com/Microsoft/TypeScript/issues/202#issuecomment-245997289
Basarat Ali Syed (@basarat)https://github.com/basarat
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-197070489
Anatoly Ressin (@Artazor)https://github.com/Artazor
wrotehttps://github.com/Microsoft/TypeScript/issues/186#issuecomment-173719173
#9163https://github.com/microsoft/TypeScript/pull/9163
microsofthttps://github.com/microsoft
on Jun 18, 2018https://github.com/microsoft/TypeScript/issues/186#event-1686902544
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/186
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/186
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
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.