Your attempt was close, but you forgot to include the generic argument declaration in front of the arrow function parameters. Try something like this:

const log = <T>(message: T): IO<void> =>
   new IO(() => console.log(message));

If you're working in a .tsx file, you may need to do something a little more complex to make it work.

Answer from JKillian on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › Arrow_functions
Arrow function expressions - JavaScript - MDN Web Docs
February 21, 2026 - Arrow functions can be async by prefixing the expression with the async keyword. ... Let's decompose a traditional anonymous function down to the simplest arrow function step-by-step.
Discussions

typescript - Convert to Arrow Function - Stack Overflow
I'm learning Typescript. I want to convert this to an arrow function: More on stackoverflow.com
🌐 stackoverflow.com
March 16, 2021
angular - Javascript Convert function to arrow function - Stack Overflow
The this object is undefined, because it is out of scope. To fix this, I can change the existing function(value) to rather use arrow notation (then the this object will be in scope). More on stackoverflow.com
🌐 stackoverflow.com
typescript: How to write an arrow function with type declaration? - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Ask questions, find answers and collaborate at work with Stack Overflow for Teams More on stackoverflow.com
🌐 stackoverflow.com
"Convert function declaration to expression or arrow function" (and vice versa)
Hey @nicoespeon. I just watched your fantastic workshop, thank you so much. In the workshop you demonstrate a refactoring for converting function declarations to arrow functions. Do you think we co... More on github.com
🌐 github.com
13
June 26, 2020
🌐
Tutorial Teacher
tutorialsteacher.com › typescript › arrow-function
TypeScript Arrow Functions
Fat arrow notations are used for anonymous functions i.e for function expressions. They are also called lambda functions in other languages. ... Using fat arrow =>, we dropped the need to use the function keyword.
🌐
Charandev
charandev.com › convert-your-traditional-functions-into-arrow-functions-in-3-simple-steps
https://charandev.com/convert-your-traditional-fun...
Hey there 👋 I’m Sai Charan, a full-stack web developer👨‍💻, photographer📸 and technology enthusiast📱 who specializes in front-end development.
🌐
Folkstalk
folkstalk.com › home › 2022 › september
Convert Function To Arrow Function Typescript With Code Examples
September 17, 2022 - When we convert a traditional javascript function into an arrow function we can use the following steps: We can start with the traditional function and we can remove the function keyword along with the function name.
🌐
Plain English
plainenglish.io › blog › how-to-convert-any-function-to-an-arrow-function-in-javascript-afb0c87e411d
How To Convert Any Function To An Arrow Function In JavaScript
December 1, 2012 - For the right side of the arrow: If the function only returns an expression, then you can remove the “return” keyword along with the curly braces around the function body. In this case, the result of the expression will be automatically returned. If the returned expression is too large to fit in a single line, you can use parentheses around it. This is especially more commonly used in React.js development. Following the steps above, you can fully convert your traditional function into an arrow function.
Find elsewhere
🌐
Dyclassroom
dyclassroom.com › typescript › typescript-arrow-functions
TypeScript - Arrow Functions - TypeScript - dyclassroom | Have fun learning :-)
In this tutorial we will learn about arrow functions in TypeScript. An Arrow Function a.k.a. Fat Arrow Function, are concise way of writing a function expression. In the following example we have two ways of writing a function in ES5 and ES6 style of coding. // ES5 var getResult = function(username, points) { return username + ' scored ' + points + ' points!'; }; // ES6 var getResult = (username: string, points: number): string => { return `${ username } scored ${ points } points!`; } To create an arrow function with no parameters and no return value we use the given syntax.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Convert To Arrow Function - Visual Studio Marketplace
May 29, 2023 - Extension for Visual Studio Code - Convert To Arrow provides a convenient way to convert named functions to arrow functions in js/ts or jsx/tsx.
🌐
GitBook
basarat.gitbook.io › typescript › future-javascript › arrow-functions
Arrow Functions | TypeScript Deep Dive
February 12, 2020 - Lovingly called the fat arrow (because -> is a thin arrow and => is a fat arrow) and also called a lambda function (because of other languages). Another commonly used feature is the fat arrow function ()=>something. The motivation for a fat arrow is: ... For a language that claims to be functional, in JavaScript you tend to be typing function quite a lot.
🌐
typescriptlang.org
typescriptlang.org › docs › handbook › 2 › functions.html
TypeScript: Documentation - More on Functions
They’re also values, and just like other values, TypeScript has many ways to describe how functions can be called. Let’s learn about how to write types that describe functions. The simplest way to describe a function is with a function type expression. These types are syntactically similar to arrow ...
🌐
Team Treehouse
teamtreehouse.com › library › convert-to-arrow-function-expressions
Convert to Arrow Function Expressions (How To) | Practice Arrow Functions in JavaScript | Treehouse
Convert to Arrow Function Expressions. Turn regular function declarations into arrow function expressions.
Published   September 10, 2018
🌐
TutorialsPoint
tutorialspoint.com › typescript › typescript_arrow_functions.htm
TypeScript - Arrow Functions
The fat arrow notation/lambda notation (=>) − It is also called as the goes to operator. Statements − represent the functions instruction set · Let's understand the arrow functions/ lambda function with the help of some examples in TypeScript −
🌐
GeeksforGeeks
geeksforgeeks.org › typescript › explain-the-arrow-function-syntax-in-typescript
Explain the arrow function syntax in TypeScript - GeeksforGeeks
September 11, 2025 - In this example, we create a function to add two integers. The function takes two parameters of type number and returns their sum, also of type number ... let addNumbers = (num1: number, num2: number): number => { return num1 + num2; }; console.log(addNumbers(100, 40)); console.log(addNumbers(150, 30)); console.log(addNumbers(120, 70)); ... In this example, we create a function that returns a string composed of three different data types.
🌐
GitHub
github.com › nicoespeon › abracadabra › issues › 113
"Convert function declaration to expression or arrow function" (and vice versa) · Issue #113 · nicoespeon/abracadabra
June 26, 2020 - https://github.com/xsburg/vscode-javascript-booster/blob/c2f1d10a2c256e8f4765ab7e6dc88e8a6629fc26/server/src/codemods/convert-fn-expr-to-arrow-fn.ts · Although when I tried it they seemed to lose TypeScript generics.
Author   OliverJAsh