Typelevel Programming 101: The Subspace of Scala
summary
Scala code encodes booleans, Peano natural numbers, and vectors whose lengths are tracked and enforced at compile time, using implicits, structural type lambdas, and shapeless/illTyped tests so bad cases fail to compile instead of throwing runtime exceptions. Examples include typed map, fold and concatenation that compile and run, with the real repo and tests available. Practical limit: deeply recursive type computations hit the compiler (stack) around ~1024 and can hang or overflow.
AI-written summary · about
chapters (39)
- 0:00Intro
- 1:16Joes background
- 2:06What do I know about Scala
- 3:09What is Scala
- 6:27Type assignment
- 7:08Billions
- 8:30Type parameters
- 10:41Compile
- 12:16IllType
- 14:01Syntax Trick
- 15:18Two Types
- 15:28Natural Numbers
- 17:25Type Version
- 18:57Value
- 19:32Recursive
- 20:38Vectors
- 21:48Convenience Constructor
- 23:59Validate Sizes
- 24:17Validation
- 25:26Nonempty vector
- 27:57Zero
- 28:21Type Signature
- 29:16Concatenate
- 29:37NonEmpty
- 29:59Combining operators
- 30:33The next day
- 30:51The type list
- 32:13Reduce
- 33:14Map
- 33:40Type Lambda
- 36:00Type Map
- 37:27Github
- 38:35Fold
- 39:35Line Breaks
- 41:26Agile
- 41:40Shape
- 41:50Compile Time
- 42:20Type outages propagate
- 43:06What if you dont know the size in advance
related talks
49mType level Programming in Scala
32mUnderstanding the Type System of Scala 3
24mLet the Scala compiler work for you
48mAcademese to English: A Practical Tour of Scala’s Type System
01h 01mTypesafe Scala, Typelevel Scala – What’s Going On, Anyway?
45mHow to be polymorphic in Scala
32mAdvanced Features of Scala 3
38mThinking in Scala 3 Types
