AI 资讯
Understanding Monads in TypeScript: A Practical Guide
You have read five blog posts about monads. Each one started with category theory, mentioned burritos, and left you more confused than before. Let's skip all of that. Here is the short version: a monad is a container that supports three operations. You already use two monads every day in TypeScript — Promise and Array . Once you see the pattern, every monad in @oofp/core will feel familiar. The Three Operations Every monad has three things: of(a) — Put a value into the container. map(f) — Transform the value inside, keep the container shape. chain(f) — Transform the value into a new container, then flatten. That's it. If a type supports these three operations and follows a few simple laws, it's a monad. Let's see this with types you already know. Promise — a monad you use daily // of — wrap a value const p = Promise . resolve ( 42 ); // map — transform the inside (then with a plain return) const doubled = p . then (( x ) => x * 2 ); // Promise<number> // chain — transform into a new Promise (then with an async return) const fetched = p . then (( id ) => fetch ( `/api/users/ ${ id } ` )); // Promise<Response> Promise.resolve is of . .then acts as both map and chain — JavaScript conflates them. When your callback returns a plain value, it's map . When it returns a Promise , it's chain . The runtime flattens the nested Promise<Promise<T>> into Promise<T> automatically. Array — another monad hiding in plain sight // of — wrap a value const arr = [ 42 ]; // map — transform each element const doubled = arr . map (( x ) => x * 2 ); // [84] // chain — transform each element into an array, then flatten const expanded = arr . flatMap (( x ) => [ x , x * 10 ]); // [42, 420] Array.of (or just [value] ) is of . .map is map . .flatMap is chain . Same pattern, different container. The insight is: chain is map followed by flatten . That's why it's also called flatMap or bind . You apply a function that returns a new container, then flatten the nested result. Maybe: Eliminating null
科技前沿
Does charging your phone in your car waste gas?
Charing your phone in the car may technically use energy, but not enough to give a second thought.
创业投融资
Nvidia is sending GPUs to the moon
If there's a place in the universe without GPUs, Nvidia is sending them there.
AI 资讯
Edtech platform raises $4.5M to help teach students how to vibe code
Imagi announced a $4.5 million seed round, with investors including Brighteye Ventures, Day One Capital, and artist Will.i.am.
AI 资讯
AI chip startup Etched defies skeptics, hits $10.3B valuation from big-name investors
Etched, founded by three Harvard dropouts, has created new chips and memory components that speed up inference on any AI model -- no GPUs required, it says.
AI 资讯
Amazon’s best 4K streaming sticks are up to 40 percent off
There’s no shortage of great shows and movies to watch, but discovering something new isn’t always easy. Amazon’s Fire TV Stick 4K Plus and Fire TV Stick 4K Max come with redesigned software that aims to make it easier to finding something you’ll like, and both 4K-ready streaming sticks are back to their lowest prices […]
产品设计
The new Halo remake is a reminder of what Xbox used to be
It's impossible to talk about a new Xbox game without also talking about the state of Xbox. Microsoft's gaming division is in freefall: Recent headlines are dominated by extensive layoffs, decimated studios, and confusing strategies, most of which stem from years of bad decisions and expensive acquisitions. But it wasn't always that way. Through its […]
AI 资讯
The latest Resident Evil movie trailer has lots of fun nods to the games
The film, from Weapons director Zach Cregger, hits theaters on September 18.
AI 资讯
Amazon is bringing games to Prime Video
Amazon is hoping the addition of games can turn Prime Video into a one-stop entertainment destination, borrowing a strategy from Netflix, which has increasingly embraced party games over the past several years.
AI 资讯
AI arms race in line for a reckoning after OpenAI hacking incident
Aggressive training techniques sharpens threat of bad behavior by leading models.
开发者
🐍 Snake - rendered with 576 browser windows [warning - this WILL hurt your eyes...and PC!]
I have been quiet lately I know - but don't worry I haven't forgotten you all and how much you like...
开发者
Lego's latest Nintendo collab is a playable Donkey Kong arcade machine
Barrels of fun.
AI 资讯
Expedia Uses AI Driven Service Telemetry Analyzer to Accelerate Incident Investigation
Expedia Group has introduced STAR, an internal AI-assisted observability platform that helps engineers investigate production incidents using service telemetry and LLMs. Built with FastAPI, Datadog, Celery, Redis, and Langfuse, STAR follows structured workflows to analyze telemetry, generate root cause assessments, and support incident response while keeping engineers in the loop. By Leela Kumili
AI 资讯
Lawmakers prepare bill requiring AI ‘kill switch’
Lawmakers are preparing to introduce an "AI Kill Switch Act" that would require AI companies to shut down or throttle their systems on orders from the Department of Homeland Security, according to a report from Politico. Reps. Ted Lieu (D-CA) and Nathaniel Moran (R-TX) are expected to introduce the legislation on Thursday. The news of […]
科技前沿
I'm just glad Samsung's price hikes weren't worse
It's a sign of how hard we're braced for the RAMpocalypse that Samsung adding just $100 to its prices seems reasonable.
AI 资讯
Your backstage pass to TechCrunch Disrupt 2026 is waiting
Volunteer at TechCrunch Disrupt 2026 and get a behind-the-scenes look at how one of the world's biggest startup conferences gets built.
AI 资讯
Ford bets on Apple for its next-generation of EVs
Ford is the first automaker to use a new set of developer tools that will let it embed Apple Maps navigation and mapping directly into its vehicles' infotainment systems.
AI 资讯
Ford picks Apple Maps for its next EV platform and updated BlueCruise
Ford plans to embed Apple Maps directly into its Universal Electric Vehicle Platform, which will start with a $30,000 midsize pickup truck set for release in 2027. In an announcement on Thursday, Ford says it will use Apple Maps to offer "turn-by-turn directions using natural language, real-time traffic and incident information, intuitive search featuring detailed […]
开源项目
🔥 Automattic / harper - Offline, privacy-first grammar checker. Fast, open-source, R
GitHub热门项目 | Offline, privacy-first grammar checker. Fast, open-source, Rust-powered | Stars: 11,873 | 590 stars today | 语言: Rust
开源项目
🔥 freemocap / freemocap - Free Motion Capture for Everyone 💀✨
GitHub热门项目 | Free Motion Capture for Everyone 💀✨ | Stars: 9,664 | 74 stars today | 语言: TypeScript