PLAY PODCASTS
042: Comparing TypeScript and Elm's Type Systems
Episode 42

042: Comparing TypeScript and Elm's Type Systems

TypeScript and Elm have very different type systems with different goals. We dive into the different features and the philosophy behind their different designs.

Elm Radio

October 25, 20211h 8m

Audio is streamed directly from the publisher (cdn.simplecast.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

TypeScript's any vs. Elm's Debug.todo

TypeScript's any essentially "turns off" type checking in areas that any passes through.

In Elm:

  • You can get a type that could be anything with Debug.todo, but you can't build your app with --optimize if it has Debug.todo's in it
  • You will still get contradictions between inconsistent uses of a type that could be anything (see this Ellie example)

This Ellie example (with compiler error as expected) and this TypeScript playground example (with no error) show the difference.