Enhancing your Haskell with Dependently Typed Programming
summary
Dependently-typed Haskell is used to build a neural‑network implementation whose linear algebra stays identical but whose dimension mismatches move from runtime crashes to compile‑time errors. The code uses HMatrix for BLAS-backed vectors/matrices, GHC extensions (DataKinds, TypeLits, KnownNat), and the singletons pattern to reflect sizes at runtime. Result: backprop and random weight generation compile as before yet become total runNet functions with shape safety and no silent dimension bugs.
AI-written summary · about
chapters (8)
- 0:00Neural network basics
- 2:26Naive Haskell implementation
- 6:21Issues with untyped code
- 10:45Limitations of testing
- 17:51Introduction to data kinds
- 22:50Typed neural networks
- 31:58The singleton pattern
- 38:10Conclusion and Q&A
related talks
39mDependent Types in Haskell
50mUsing Dependent Types in Mathematical Optimization Algorithms
45mDepending on Types
01h 20mA Practical Introduction to Haskell GADTs
49mType Theory Behind the Glasgow Haskell Compiler Internals (Part 2)
34mDifferentiable Functional Programming
01h 57mTypes as Program Specifications: A Intro to Type-Level Programming in Haskell
01h 01mType Theory Behind the Glasgow Haskell Compiler Internals (Part 6)
