Nothing
Nothing is a Maybe constructor representing the absence of a contained value or additional failure information.
Functional Programming in JavaScript
A Maybe case that represents the absence of a value or a failure without extra detail.
- How it is used
- Represents missing results in Maybe-based lookup and chaining flows.
- How deep it goes
- Defines the empty Maybe case and shows how it preserves map chains and fallback handling, but not custom Nothing internals.
- Examples
- Uses safe student lookup, chained property access, and the error 'Can't extract the value of a Nothing.'
- What you can do after
- Apply Maybe to keep missing data explicit while chaining operations and supplying defaults.
Read how Functional Programming in JavaScript explains Nothing →
Learn Haskell by Example
Nothing is the Maybe constructor representing the absence of a contained value.
- How it is used
- Represents missing or optional results while keeping failure explicit and non-crashing.
- How deep it goes
- Defines the constructor and demonstrates pattern matching, defaults, and associative-list updates without covering deeper Maybe abstractions.
- Examples
- Uses argument parsing, fromMaybe defaults, and an alter function where Nothing removes or signifies a missing mapping.
- What you can do after
- Apply Nothing through pattern matching to represent absence, choose defaults, and control pure updates.
Related concepts
- maybe functionpart of · The maybe function eliminates a Maybe value by returning a default for Nothing or applying a handler to the contained value.
- readMaybeproduced by · readMaybe is a Haskell function that parses a String into a value of a Read instance and returns Nothing when parsing fails.
- optionuses · An option type is a type that explicitly represents either a value of a specified type or the absence of a value.
- Justalternative to · Just is a constructor of the Maybe type that represents a present value by wrapping it.
- monadpart of · A monad is a functional abstraction that encapsulates computational context and provides operations for composing computations while preserving that context.
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.

