Haskell
Table of Contents
1. State# "Monad"
The IO Monad is ultimately State# RealWorld
- Note in
Prim.hsabout theState#type constructor - Apparently it lives in the
GHC.Primmodule. - primops notes that
State#is represented by nothing at all, soState# ais an empty type. IO ais/was defined inGHC.Prim.Typesasnewtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #)).
2. References
- Ben Lynn's notes on Haskell compiler
- John Hughes,
THE DESIGN AND IMPLEMENTATION OF PROGRAMMING LANGUAGES
2.1. Type Checking
- Dimitrios Vytiniotis, Simon Peyton Jones, Tom Schrijvers, Martin Sulzmann,
"OutsideIn(X): Modular type inference with local assumptions".
Journal of Functional Programming 21 (2011) pp. 333–412 Eprint