Building a web library using super hard Haskell
summary
Builds a JWT-focused web library that replaces the usual HashMap Text Value payload with a statically described map of symbol→type pairs so keys and types are known at compile time, encodes fixed claims via FFI to C JWT code, uses type families and open-product style kinds to enforce uniqueness and forbid registered claims at compile time, applies GHC rewrite RULES to avoid copying literal keys, relies on unsafePerformIO/unsafeCoerce carefully for existentials, and ships a working library.
AI-written summary · about
chapters (33)
- 0:00Intro
- 1:15Title
- 3:23What is hard Haskell
- 4:26Benefits of simple Haskell
- 7:45Scala vs Haskell
- 8:27Why Haskell
- 9:15JSON Web Token
- 11:26Problems with JSON
- 16:21Adding libraries
- 17:07Bindings
- 18:19Header files
- 18:39Linker errors
- 19:24Wrappers
- 19:59Writing in Haskell
- 21:04Wrapping by
- 22:29string literals
- 23:26gtamp simplestats
- 23:47Simple type classes
- 25:15JWTio
- 27:40UnsafePerformIO
- 29:03Type System
- 31:08Type System Extension
- 33:05Tick Symbol
- 33:45Type Level
- 35:37Teaser
- 37:31Mapping
- 40:07Implementing
- 41:58SaveWave
- 42:55Encoding
- 44:34Type classes
- 45:31Metadata
- 46:19Handling arbitrary products
- 47:22Handling custom type errors
