Better HN
topnewbestaskshowjobs
Log inSign up

gvergnaud

7 karma · joined Mar 15, 2021 (5y ago) · 6 submissions

Submissions

1.

Show HN: Bise – a multi-agent harness, made for humans(bise.dev ↗)

10 points · by gvergnaud · 2mo ago · 3 comments

2.

Type-Level TypeScript – Objects and Records(type-level-typescript.com ↗)

1 points · by gvergnaud · 4y ago · discuss

comment 4y ago · link · parent

Actually, this won't work with union types! The definition of `Equal` I use is this one:

type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends < T >() => T extends Y ? 1 : 2 ? true : false;

Understanding this requires a bit more context, but I'll explain why we need something so complicated in the Advanced Union Types chapter :)

I picked it from https://github.com/type-challenges/type-challenges which is an awesome resource too

comment 4y ago · link · parent

It's actually not in the standard library, but you can write it yourself:

type Expect<T extends true> = T;

`T extends true` puts a type constraint on the parameter, which then needs to be assignable to the literal type `true` to type-check.

comment 5y ago · link · parent

Thanks! Hope you'll enjoy using it

6.

Bringing Pattern Matching to TypeScript Introducing TS-Pattern v3.0(dev.to ↗)

7 points · by gvergnaud · 5y ago · 2 comments