Variance Annotations in TypeScript, Functional Programming

TypeScript Weekly

Issue #187 — March 31, 2022

Functional Programming in TypeScript

How Haskell knowledge can help you write better TypeScript code in a functional programming style.

Aleksandr Pakulev

Optional Variance Annotations in TypeScript 4.7

The upcoming TypeScript 4.7 release will implement support for variance annotations which will let us mark type parameters as covariant, contravariant, or invariant using the in and out keywords. (If you find the concept of variance confusing, don’t sweat it too much! Variance annotations are definitely a niche feature of the type system.)

Anders Hejlsberg

Strong Types, Weakly Held

John goes over the Type Annotations ECMAScript proposal which adds type annotation syntax (but not type checking) to JavaScript. The proposal recently reached stage 1 of the TC39 process.

John Reilly

How Some TypeScript Utility Types Are Implemented

TypeScript provides various utility types to help us manipulate other types. A walkthrough of how some of these utility types are implemented in the type declaration files that ship with the TypeScript compiler.

Huy

Partners

  • This Week In React: the best of React & React Native news. Sebastien filters the noise, and you save time!
  • ES.next News: learn about the latest in JavaScript and cross-platform tools.
  • Tailwind Weekly: all things Tailwind CSS, new issue every Saturday.

Curated by Marius Schulz
Twitter / Blog / Email

Older messages

Typing Polymorphic Functions, Wordle in the Type System

Monday, March 21, 2022

TypeScript Weekly Issue #186 — March 21, 2022 Type Polymorphic Functions In TypeScript How to statically type functions that behave differently depending on the number and types of their arguments.

TypeScript 4.6, Type Syntax in JavaScript

Thursday, March 10, 2022

TypeScript Weekly Issue #185 — March 10, 2022 Announcing TypeScript 4.6 TypeScript 4.6 is out and ships with various quality-of-life improvements to TypeScript. Most notably, this includes control flow

TypeScript 4.6 RC, Assertion Functions, Type Hierarchy

Sunday, February 27, 2022

TypeScript Weekly Issue #184 — February 27, 2022 Announcing TypeScript 4.6 RC The release candidate of TypeScript 4.6 is out and ships with various quality-of-life improvements to TypeScript. Most

10 Most Popular Posts from 2021

Wednesday, February 9, 2022

TypeScript Weekly Issue #183 — February 6, 2022 Hi there! 👋 This is the first issue of TypeScript Weekly in 2022. Welcome back if you've been with us last year already, and welcome aboard if you

Function Overloads, Control Flow Analysis, Type | Treat

Friday, December 10, 2021

TypeScript Weekly Issue #182 — December 9, 2021 Get the Best of TypeScript Control Flow Analysis This article will show some simple type construction patterns, code writing habits, and compiler options

You Might Also Like

Charted | Global Economic Confidence in 2025, by Country 🌎

Wednesday, December 25, 2024

While emerging markets in Asia have the strongest confidence in the global economy looking ahead, European countries are most pessimistic. View Online | Subscribe | Download Our App FEATURED STORY

Top Tech Deals 🎅 Sony Headphones, iPhone Cases, 4K Projector, and More!

Wednesday, December 25, 2024

The season of giving is upon us. How-To Geek Logo December 25, 2024 Top Tech Deals: Sony Headphones, iPhone Cases, 4K Projector, and More! The season of giving is upon us. Happy Holidays! If you're

Why the Race to AGI is Humanitys Defining Moment

Wednesday, December 25, 2024

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, December 25, 2024? The

Iran's Charming Kitten Deploys BellaCPP: A New C++ Variant of BellaCiao Malware

Wednesday, December 25, 2024

THN Daily Updates Newsletter cover The Data Science Handbook, 2nd Edition ($60.00 Value) FREE for a Limited Time Practical, accessible guide to becoming a data scientist, updated to include the latest

Software Testing Weekly - Issue 251

Wednesday, December 25, 2024

GitHub Copilot is free! 🤖 View on the Web Archives ISSUE 251 December 25th 2024 COMMENT Welcome to the 251st issue! In case you missed it — GitHub Copilot is free! The free version works with Visual

Daily Coding Problem: Problem #1647 [Medium]

Tuesday, December 24, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Square. In front of you is a row of N coins, with values v 1 , v 1 , ..., v n . You are

Sentiment Analysis, Topological Sort, Web Security, and More

Tuesday, December 24, 2024

Exploring Modern Sentiment Analysis Approaches in Python #661 – DECEMBER 24, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Exploring Modern Sentiment Analysis Approaches in Python What are the

🤫 Do Not Disturb Mode Is My Secret to Sanity — 8 Gadgets I Want To See Nintendo Make

Tuesday, December 24, 2024

Also: The Best Christmas Movies to Watch on Netflix, and More! How-To Geek Logo December 24, 2024 Did You Know Their association with the Christmas season might make you think poinsettias hail from a

😱 AzureEdge.net DNS Retiring Jan. 2025, 🚀 Microsoft Phi-4 AI Outperforms, 🔒 Microsoft Secure Future Initiative

Tuesday, December 24, 2024

Blog | Advertise | View Online Your trusted source for Cloud, AI and DevOps guidance with industry expert Chris Pietschmann! Phi-4: Microsoft's New Small Language Model Outperforms Giants in AI

Mapped | The Top Health Insurance Companies by State 🏥

Tuesday, December 24, 2024

In 13 US states, a single company dominates the health insurance market, holding at least half of the total market share. View Online | Subscribe | Download Our App Presented by: Global X ETFs Power