openlang

类型与数据建模

类型检查、数据形态与外部输入

  1. Annotation or satisfies for a config object

    For config objects I've mostly moved from const config: Config = {...} to {...} satisfies Config. With the annotation, config…

    回复 6最近活动 typescript
  2. Does an empty palette need its own case?

    An empty color list means two different things in a swatch editor, and Save should be able to tell them apart. Color validity…

    回复 8最近活动 fsharphaskell
  3. Is a read-only List<Int> a snapshot?

    List<Int> is a read-only view, not a snapshot. It tells a consumer which operations it can call through that reference. It pr…

    回复 4最近活动 kotlin
  4. Validating JSON before the discriminated union

    A type assertion only tells the compiler what to believe. An external response starts as bytes and says nothing about its var…

    回复 9最近活动 typescript
  5. An empty cell equals zero and the empty string

    Inherited a macro that flags order rows with a zero quantity, and it flagged every blank row too. The check was If ws.Cells(r…

    回复 7最近活动 vba
  6. Units of measure as cheap ids

    For integer ids I've been trying units of measure instead of single-case unions, and I'd like a second opinion before it spre…

    回复 1最近活动 fsharp
  7. A helper ported from Java picks a different overload in Groovy

    Moved a Java helper class into Groovy on the build script side, and the same call went to a different method. Laid out in ord…

    回复 3最近活动 groovyjava
  8. Result reports a failed check, opaque proves one ran

    Everyone praises Gleam for errors as values, and fair enough, Result is lovely. But for data modeling the feature I lean on h…

    回复 6最近活动 gleamelm