Variables in Haskell
summary
Survey of concrete mutable options: IORef/STRef for scoped mutation (runST types prevent escape), MVar semantics for take/read based synchronization and simple semaphores, TVar/STM atomically for optimistic transactional updates, and monotonic LVar-style structures plus monad-par/IVar for futures and deterministic dataflow. Examples include an ST-based graph traversal that runs much faster than the pure rebuild, a forkIO + MVar summation that coordinates threads, a working chat built on STM, and the unsafePerformIO global‑var hack warned against.
AI-written summary · about
chapters (36)
- 0:00Introduction
- 1:09Why variables in Haskell
- 3:01Variable Landscape
- 4:11Models of Computation
- 4:53St Mona
- 6:24Simple example
- 7:42Multiple references
- 8:47Hash tables
- 10:14Graph traversal
- 11:18Typical traversal algorithm
- 11:59Pure traversal algorithm
- 19:04IRFs
- 19:57Global Variable
- 20:47Inline
- 23:18Hidden Parallelism
- 24:02Spawn
- 25:19Parallel
- 25:52Runtime
- 27:11Data Flow
- 28:24Ivers
- 29:10Precondition
- 31:25St and Part
- 32:33Coyote
- 33:39Thread Delay
- 34:20Communication
- 35:32Mbar
- 37:35Warranty
- 37:54Real Threat
- 39:33Fork IO
- 40:13Code
- 41:53Channels
- 44:08Atomically
- 44:35New Variables
- 45:56Random
- 47:35Conclusion
- 50:26Exception Landscape
related talks
01h 33mWhy You Should Use Software Transactional Memory
36mATOMICALLY { DELETE YOUR ACTORS }
01h 04mHaskell - A Peek Inside the Ivory Tower
01h 22mHaskell for Everyday Programmers
34mMonad Transformer State
01h 09mWhy Functional Programming with Linear Types Matters
03h 29mConcurrency with Clojure
27mOpen Transactional Actions: Interacting with non-transactional resources in S...
