IO
An IO abstraction is a programming construct that represents input/output operations or computations that interact with the external world.
Learn Haskell by Example
An IO action is a Haskell computation that describes interaction with the external world and may produce input/output effects.
- How it is used
- Separates operating-system interaction from pure program logic while building command-line input and output.
- How deep it goes
- Explains action types, do sequencing, recursion, branching, return, pure boundaries, and IO’s monadic role; defers do notation’s general monad details.
- Examples
- Demonstrates an echo program, uppercase input, a recursive line-numbering interaction, command-line help selection, and GHCi evaluation.
- What you can do after
- Apply it to sequence input and output, combine effects with pure transformations, and stop recursive interactive actions conditionally.
Functional Programming in JavaScript
A monadic abstraction for describing and sequencing input/output or other side-effecting actions as values.
- How it is used
- Encapsulates DOM reads and writes so side effects can participate in composable functional pipelines.
- How deep it goes
- Implements IO with constructor, map, chain, and run, then works through a deferred DOM update.
- Examples
- Uses a student-name DOM element transformed with start case, plus a student lookup pipeline wrapped with liftIO.
- What you can do after
- Build it from scratch as a small JavaScript IO type and defer a DOM update until run.
Functional Programming in Scala, Second Edition
IO is a monadic abstraction that represents effectful computations as values whose execution can be controlled separately from their description.
- How it is used
- Separates external interactions from pure program logic by representing requested effects as IO values.
- How deep it goes
- Develops IO[A] through monadic sequencing, reified control flow, tail-recursive interpretation, and its stack-safety and streaming limits.
- Examples
- Uses contest output, a Fahrenheit-to-Celsius console converter, a factorial REPL, and file conversion to demonstrate IO.
- What you can do after
- Build it from scratch as a delayed, monadic, stack-safe description of console and other external operations.
Read how Functional Programming in Scala, Second Edition explains IO →
Type-Driven Development with Idris
An IO action is an Idris computation that can interact with the external world and return a result.
- How it is used
- Uses IO to describe interactive programs while preserving pure functions.
- How deep it goes
- Explains evaluation versus execution and develops action sequencing with types, REPL feedback, and runnable definitions.
- Examples
- Demonstrates a greeting, an interactive string reversal, and a program that reads and prints a string’s length.
- What you can do after
- Build interactive console programs from IO actions and execute them at the REPL or as standalone executables.
Julia as a Second Language
IO is Julia's abstract supertype for values that provide input and output operations.
- How it is used
- Uses IO as a common interface for reading and writing files, buffers, processes, and network connections.
- How deep it goes
- Explains shared operations and subtype limitations through runnable examples, then points to built-in help for further details.
- Examples
- Demonstrates pizza-sales export, rocket-engine CSV reading and saving, a grep process, and a netcat connection.
- What you can do after
- Apply it via Julia’s IO functions to read and write data across several kinds of sources and destinations.
The Well-Grounded Rubyist, Fourth Edition
An I/O object is a Ruby object that represents an input or output stream and provides operations for transferring data.
- How it is used
- Represents input and output streams as objects for interacting with files, keyboards, screens, and other devices.
- How deep it goes
- Explains stream objects, common output methods, enumeration, record separators, and file modes without detailing system-call internals.
- Examples
- Demonstrates writing to STDERR, iterating over STDIN lines, and writing then appending data to a file.
- What you can do after
- Operate on streams using output methods, enumerate input records, and write or append data through File objects.
Read how The Well-Grounded Rubyist, Fourth Edition explains IO →
Functional Design and Architecture: Examples in Haskell
IO is the Haskell type constructor for computations that may perform input, output, or other external effects.
- How it is used
- Separates pure calculations from external effects and confines those effects to an explicit call chain.
- How deep it goes
- Explains effect propagation and demonstrates a complete program, but does not detail IO runtime implementation.
- Examples
- Uses max, printNumber, printMaxNumber, main, and concurrent state-management structures.
- What you can do after
- Evaluate which functions perform effects and organize effectful or concurrent behavior behind explicit boundaries.
Read how Functional Design and Architecture: Examples in Haskell explains IO →
What to know first
- pure functionA pure function is a function whose result depends only on its explicit inputs and whose evaluation has no externally observable side effects.
- algebraic data typeAn algebraic data type is a composite type whose values are formed from product structures, finite alternatives, or both through type constructors.
- functional programmingFunctional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
- HaskellHaskell is a statically typed, purely functional general-purpose programming language with non-strict, typically lazy evaluation.
Related concepts
- abstract typekind of · An abstract type defines a general abstraction or interface without representing a directly instantiated concrete implementation.
- bind operatorused by · The Idris Prelude operator >>= sequences computations by passing the result of one computation to a function that produces the next.
- file descriptorincludes · A file descriptor is an operating-system identifier for an open file, socket, pipe, or other input-output resource.
- read methodused by · A read method obtains data from an input source, typically returning it or delivering it to a consumer.
- interactive programproduced by · A program that describes interactions with the external world, such as reading input or displaying output.
Questions about IO
What is IO?
An IO abstraction is a programming construct that represents input/output operations or computations that interact with the external world.
Which Manning books explain IO?
Learn Haskell by Example, Functional Programming in JavaScript, Functional Programming in Scala, Second Edition, Type-Driven Development with Idris, Julia as a Second Language, The Well-Grounded Rubyist, Fourth Edition and Functional Design and Architecture: Examples in Haskell.
What should I know before learning IO?
Manning books that teach IO usually introduce pure function, algebraic data type, functional programming and Haskell first.
What kinds of IO are there?
Kinds of IO include file descriptor and IOBuffer.
What is IO a kind of?
IO is a kind of abstract type. An abstract type defines a general abstraction or interface without representing a directly instantiated concrete implementation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






