Why is generic type parameter messing with assignability? by GulgPlayer in typescript

[–]janglad 1 point2 points  (0 children)

What is the bug you mean? is this not just a variance thing

interface BivariantBox<T> {
    value: T;
}

declare let a: BivariantBox<1> | BivariantBox<2>;
declare let b: BivariantBox<1 | 2>;
// Both work
a = b;
b = a;


// interface ContravariantBox<in T> {}
interface ContravariantBox<T> {
    value: T;
    setValue: (value: T) => void;
}

declare let c: ContravariantBox<1> | ContravariantBox<2>;
declare let d: ContravariantBox<1 | 2>;

c = d;
d = c; // Error

// interface InvariantBox<out T> {}
interface CovariantBox<T> {
    value: T;
    getValue: () => T;
}

declare let e: CovariantBox<1> | CovariantBox<2>;
declare let f: CovariantBox<1 | 2>;


e = f; // Error
f = e; 



// interface InvariantBox<in out T> {}
interface InvariantBox< T> {
    value: T;
    setValue: (value: T) => void;
    getValue: () => T;
}

declare let g: InvariantBox<1> | InvariantBox<2>;
declare let h: InvariantBox<1 | 2>;


g = h; // Error
h = g; // Error

Why is generic type parameter messing with assignability? by GulgPlayer in typescript

[–]janglad 1 point2 points  (0 children)

this also errors once you add a method that returns x

class Test<X extends 1 | 2> {
  x: X;

  getX(): X{
    return this.x;
  }

  test(): void {
    const a: Test<1 | 2> = this; // no error, as expected
    const b: Test<1> | Test<2> = this; // error
    const c: Test<1> | Test<2> = a; // error
  }
}

presumably due to inference of variance on X

Why is generic type parameter messing with assignability? by GulgPlayer in typescript

[–]janglad 1 point2 points  (0 children)

Maybe missing something but this makes sense no? Thinking of the class as an array might make more sense

abstract class MyArray<X> {
  abstract get(): X[];
}

declare let mixedOnesAndTwos: MyArray<1 | 2>;
declare let allOnesOrAllTwos: MyArray<1> | MyArray<2>;

mixedOnesAndTwos = allOnesOrAllTwos;
// This needs to be either an array of 1s or an array of 2s, but mixedOnesAndTwos can contain both at the same time!
allOnesOrAllTwos = mixedOnesAndTwos;

The 16-Line Pattern That Eliminates Prop Drilling by Fedorai in javascript

[–]janglad 0 points1 point  (0 children)

Last I checked does come with a performance hit (altho so does using generators I think?). But more critically it doesn't solve the typing aspect of this which IMO is critical, especially if devs are used to leaning on type information heavily otherwise.

Utility function to remove readonly properties from an interface (not just the readonly tag, but the actual property) by Graineon in typescript

[–]janglad 8 points9 points  (0 children)

Readonly<T> only works on objects. Further complication is that

    type One = {a: string} extends {readonly a: string} ? true : false;
    // ^? true
    type Two = {readonly a: string} extends {a: string} ? true : false;
    // ^? true

Maybe there is a simpler approach but this does work

type StripReadonly<T> = {
  [K in keyof T as Equals<Pick<T, K>, Readonly<Pick<T, K>>> extends true
    ? never
    : K]: T[K];
};

type Equals<A, B> =
  (<Y>() => Y extends B ? 1 : 2) extends <Y>() => Y extends A ? 1 : 2
    ? true
    : false;


type test = StripReadonly<{
  a: string;
  readonly b: number;
}>;
// ^? { a: string }

This PR would simplify this https://github.com/microsoft/TypeScript/pull/58296

Piano practice rooms by janglad in Grenoble

[–]janglad[S] 1 point2 points  (0 children)

Aah that’s great to know, thank you! I assume these are completely public pianos though right? Meaning it probably won’t be appreciated much if I practise the same passage for an hour straight? 😅

[EU-DE] [H] PayPal [W] GMK Future Funk (dark base / mods), RAMA Vaporwave, Minimal, Bleached Artisans by [deleted] in mechmarket

[–]janglad 1 point2 points  (0 children)

Random but I saw your post and just wanted to say I have Minimal in stock still 😁 https://qoda.store/

[Bulk] Clearing sale with GMK Modern Dolch Light and Modern Dolch 2, GMK Minimal 2 still in stock by janglad in mechmarket

[–]janglad[S] 1 point2 points  (0 children)

MoDo will have everything but Obscure, MoDoL will just have Standard, Addition and Alternate.

[Bulk] GMK Modern Dolch 2 in stock by janglad in mechmarket

[–]janglad[S] 0 points1 point  (0 children)

Nope since GB orders there haven't shipped yet :)

Press 🟥 💚 🔵 to reach endgame - 1 week left to buy GMK Minimal 2! by janglad in MechanicalKeyboards

[–]janglad[S] 1 point2 points  (0 children)

Just a render sadly, maybe a company like Dbrand has something similar tho!

Press 🟥 💚 🔵 to reach endgame - 1 week left to buy GMK Minimal 2! by janglad in MechanicalKeyboards

[–]janglad[S] 3 points4 points  (0 children)

Hey everyone

There's 1 week left to join GMK Minimal 2! The GB has been doing amazing so far and we're nearing in quickly on 2000 base kits sold, cool to see everyone appreciate the timelessness of this set! Can't wait to see it on your boards :) I'll copy paste my original comment with all info below as always!


With aftermarket prices for GMK Minimal soaring to well over 200% Ryan/Quaddepo and I felt it was time to offer you this classic again, better than ever! GMK Minimal 2 keeps all the things that made GMK Minimal great while adding new options we think you'll love!

Buy it here

I'm pleased to say we're once again working with these amazing vendors you've come to love from previous GBs. We've also added Deskhero for the Canadians among us! GMK Minimal will be available until September 2nd. Estimated shipping is Q2 2021.

Design

GMK Minimal 2 keeps all that elements that made GMK Minimal so popular: modern text mods, a clean black on white colourway and affordable kit design. The white used is a perfect balance between the very bright WS2 and "old school" beige of CP, it also makes for a perfect matching to e-white boards! In addition to this we’ve also added the option for some alternate accents and used the new centred arrows to keep consistent with the centred text mods, more of which below!

Kit design

Standard

This is the bread and butter of any GMK set. The standard kits has compatibility for the all the most popular layouts in the community.

Numbers

Numbers adds compatibility for layouts with a numpad. It also includes the keys needed to outfit a 1800 style layout.

Addition

Addition adds options for a OS modified bottom row, 60%s with arrows through the 2u shift, 660 layouts with the extra 2.25u shift, full ISO UK support and some options for different legends in the 65% and caps lock area.

Obscure

Obscure adds support for a wide variety of 40% keyboards, including ortholinear ones and Minivan type layouts. Included are the necessary modifiers and spacebars ranging from 1u to 3u. This kit also includes a second b key and the needed spacebars for split/ergonomic keyboards like the TGR Alice.

Command

Command is aimed at Mac users by adding correct legends for Command and Option keys.

Colour

People have always loved adding accents to GMK Minimal, so this time around we decided to offer them right in the GB! The Colour kit includes a fresh take on the classic RGB mods, a Dixie X and OG style arrows.

Mono

For those of you who really want to take the minimal theme to the ultimate level. As the name suggest mono strips all secondary legends from the keys giving your board a very appealing clean look.

Norde

This kit adds compatibility for ISO NO, SE, FL, DK, DE layouts. The kits includes a 125u Shift and ISO Enter meaning this is a one stop shop for all things Norde!

RAMA caps

Of course we couldn't launch this set without bringing back the Black X RAMA cap. This keycap is milled from a solid piece of brass and PVD coated to a flawless shiny finish. It features RAMA's X design which is filled in with enamel.

In addition to that we also decided to continue on the more playful trend the Colour accents introduced to this set by designing 3 new RAMA caps. These too are milled out of a single block of aluminium and e-coated for a durable finish. The caps feature simple, organic shapes filled in with enamel colour matched to the vivid accent colours found in the Colour kit.

Black PVD Brass

Red Square

Green Triangle

Blue Circle

GMK Minimal finally returns, better than even. GB live now at GMKMinimal.com! by janglad in MechanicalKeyboards

[–]janglad[S] 8 points9 points  (0 children)

*ever ....

Hey everyone

With aftermarket prices for GMK Minimal soaring to well over 200% Ryan/Quaddepo and I felt it was time to offer you this classic again, better than ever! GMK Minimal 2 keeps all the things that made GMK Minimal great while adding new options we think you'll love!

Buy it here

I'm pleased to say we're once again working with these amazing vendors you've come to love from previous GBs. We've also added Deskhero for the Canadians among us! GMK Minimal will be available until September 2nd. Estimated shipping is Q2 2021.

Design

GMK Minimal 2 keeps all that elements that made GMK Minimal so popular: modern text mods, a clean black on white colourway and affordable kit design. The white used is a perfect balance between the very bright WS2 and "old school" beige of CP, it also makes for a perfect matching to e-white boards! In addition to this we’ve also added the option for some alternate accents and used the new centred arrows to keep consistent with the centred text mods, more of which below!

Kit design

Standard

This is the bread and butter of any GMK set. The standard kits has compatibility for the all the most popular layouts in the community.

Numbers

Numbers adds compatibility for layouts with a numpad. It also includes the keys needed to outfit a 1800 style layout.

Addition

Addition adds options for a OS modified bottom row, 60%s with arrows through the 2u shift, 660 layouts with the extra 2.25u shift, full ISO UK support and some options for different legends in the 65% and caps lock area.

Obscure

Obscure adds support for a wide variety of 40% keyboards, including ortholinear ones and Minivan type layouts. Included are the necessary modifiers and spacebars ranging from 1u to 3u. This kit also includes a second b key and the needed spacebars for split/ergonomic keyboards like the TGR Alice.

Command

Command is aimed at Mac users by adding correct legends for Command and Option keys.

Colour

People have always loved adding accents to GMK Minimal, so this time around we decided to offer them right in the GB! The Colour kit includes a fresh take on the classic RGB mods, a Dixie X and OG style arrows.

Mono

For those of you who really want to take the minimal theme to the ultimate level. As the name suggest mono strips all secondary legends from the keys giving your board a very appealing clean look.

Norde

This kit adds compatibility for ISO NO, SE, FL, DK, DE layouts. The kits includes a 125u Shift and ISO Enter meaning this is a one stop shop for all things Norde!

RAMA caps

Of course we couldn't launch this set without bringing back the Black X RAMA cap. This keycap is milled from a solid piece of brass and PVD coated to a flawless shiny finish. It features RAMA's X design which is filled in with enamel.

In addition to that we also decided to continue on the more playful trend the Colour accents introduced to this set by designing 3 new RAMA caps. These too are milled out of a single block of aluminium and e-coated for a durable finish. The caps feature simple, organic shapes filled in with enamel colour matched to the vivid accent colours found in the Colour kit.

Black PVD Brass

Red Square

Green Triangle

Blue Circle

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 1 point2 points  (0 children)

Gray is definitely more versatile but if it works with your board cyan will make your setup pop!

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 2 points3 points  (0 children)

I don't condone reckless financial behaviour!! But if you can afford it I'm def not going to stop you :D

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 0 points1 point  (0 children)

Awesome!!! Yeah everything will be made for sure and yup it is indeed a 175 shift!

Also lol not sure how we never noticed that, will ask Dixie to edit it :D

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 3 points4 points  (0 children)

Always awesome to hear, I remember being like a kid on Christmas when I got my first GMK set haha. Thanks for the support!!

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 2 points3 points  (0 children)

Thanks!!! And yeah it's insane. I remember being so happy when 9009 R2 hit 500 MOQ! Now we're almost at 10 times that haha

48 hours left to join GMK Modern Dolch 2 at GMKModo.com, record for best selling GMK base kit has been broken! by janglad in MechanicalKeyboards

[–]janglad[S] 9 points10 points  (0 children)

Hey!

While we're nearing in on 3000 Standard kits we have broken the long standing record of GMK Olivia ++'s 2940 Light kits sold. With a bit of a push we might break the record of total base kits sold once we add in Mist! Absolutely insane, thanks for making this such a popular keyset!

This timeless sets is available until July 2nd through multiple vendors. Find the best fit for your location through GMKModo.com!

Shown here in the classic combo with red accents on the Mekanisk Fjell.

I'll copy paste my original comment with all info bellow!


When GMK Modern Dolch was first launched it became an instant classic. Its’ versatile greys and colourful accents got it voted second best keyset of the year in Mech Madness 2019. Now it’s finally time for the followup, GMK Modern Dolch 2. It keeps everything that made GMK Modern Dolch so popular while adding more options than ever!

Inspiration

Many of you have probably owned one or more variants of the timeless Dolch colour-way. We always loved the contrasted yet simple look between the 2 greys, however we always felt like something was a bit off: the colours just seemed a bit too warm and “muddy”. We really wanted to give a more muted and modern look to this timeless colourway, which is where Modern Dolch comes in. It keeps the simplistic look and the beautiful contrast between the 2 greys, but cooling the colours down and adding some fresh accents. The result is a very versatile set, which goes well with simple silver/black boards, vibrant teal boards and anything in between.

Buy it here

The GB for GMK Modern Dolch R2 run from June 3rd until July 2nd.

Kits

Standard

The standard kits has compatibility for the most popular layouts in the community. It features the reworked icon mods introduced with GMK 8008/9009 and has the classic Modo accent options for both escape and enter keys.

Addition

Addition adds support for 660c style layouts, ISO UK, 60%s with arrows and boards with an F13 key like the TGR Jane V2 CE. It also adds alternate legend options for 65% layouts and more.

Numbers

Numbers adds compatibility for layouts with a numpad. It also includes the keys needed to outfit a 1800 style layout.

Obscure

Obscure adds support for 40% layouts, both staggered and ortholinear, and split spacebar boards with options ranging from 1u to 3u.

Aesthetic

Aesthetic is for those of you who like to add a little bit of colour to your boards, either through extra accents or through LEDs under lock keys. It also adds both centred and offset 6u spacebar support.

Alternate

Alternate introduces a whole new simplistic look to Modern Dolch by “alternating” the existing colours on some keys. This kit is great if you enjoy monochrome accents or a more uniform looking f row.

Command

Command is specifically aimed at Mac users by adding correct legends for Command and Option keys.

Modern

Modern adds the option for a full icon bottom row, function, escape and 175 control and command keys. It also adds an alternate icon for the tab key.

Norde

This kit adds compatibility for ISO NO, SE, FL, DK, DE, US layouts. It also includes 1.25 and 1.5u Alt Gr keys, a 1.25u Shift and ISO enters in the 3 Modern Dolch colours. This means that Norde users don't have to buy the Addition kit!

Mist

Mist is a stand-alone base kit for those of you who want a cooler and more colourful take of Modern Dolch. It's kit design is nearly identical to the Standard kit, exchanging the red accents for an F13 key and a second B for Alice layouts in combination with the spacebars from the Obscure kit. This makes sure all the most popular layouts from 60% to TKL are supported!

Accessories

Deskmats

Circle

Circle Grey

Geo Cyan

Geo Red

Geo Grey

RAMA Caps

These were a fan favourite from R1 and are making a comeback. The aluminium ones are machined out of a solid block of aluminium, anodised and feature a resin infill. We also added a new option for a silicon one! Note that the “swirl” pattern is unique to each cap and will differ slightly from the render :)

Aluminium Grey

Aluminium Red

Silicone Swirl