Haskell
Table of Contents
1. State# "Monad"
The IO
Monad is ultimately State# RealWorld
- Note in
Prim.hs
about theState#
type constructor - Apparently it lives in the
GHC.Prim
module. - primops notes that
State#
is represented by nothing at all, soState# a
is an empty type. IO a
is/was defined inGHC.Prim.Types
asnewtype 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