Why is it called "typed errors"?
The feature behind fxEither has famous names in other
ecosystems — Monad,
Railway-oriented programming. This page explains why FxDart
deliberately calls it none of those. (Never met a monad? Start with
Monad & comprehension blocks.)
Why not "Monad"?
Because it would misdescribe the feature. The whole point of the
Raise design is that it is not monadic style — it
exists to replace flatMap-chaining with
straight-line code. You saw this on the
typed errors page: the
fxEither((r) { ... }) block is the alternative to the nested
flatMap pyramid, not a wrapper around it.
Kotlin's Arrow — the design source for this feature — went through
exactly this decision. Arrow 1.x had a Monad typeclass,
higher-kinded-type emulation, and the Haskell vocabulary to go with it.
Arrow 2.x deleted all of it, and even renamed the core
operation shift → raise by community poll —
choosing the word users understood over the word theory used. The lesson
generalises: name for the audience you want, and FxDart's audience is
ordinary Dart developers, not category theorists.
There is also a cautionary tale in Dart itself: FP libraries whose public
surface speaks Haskell (Monad2, HKT,
Do-notation) intimidate exactly the developers who would
benefit most from typed errors. A page called "Monad" would scare off its
own readers — and describe the one thing this API isn't.
Why "typed errors"?
- It says what the feature does — errors carried in the type system instead of thrown past it — rather than what category theory calls the shape.
- It is Arrow's own name. The corresponding chapter of the Arrow documentation is literally titled Typed errors, so Kotlin developers searching for the Dart equivalent land on the right words.
- It follows the house rule. FxDart's naming
philosophy (see
WHY_CURRIED.md: "port the meaning, not the spelling") is: Dart names, not Haskell names —mapnotfmap,flatMapnotbind-the-verb,recovernothandleErrorWith.
Why not "raise"?
raise is the accurate "cool" name — it is what the DSL is
actually called, and tutorial URLs here are function-named
(concurrent.html, fx.html). So the function-level
pages carry it: raise.html covers the
Raise scope and either.html
covers Either. What a function name cannot do is introduce the
whole idea to someone who has not met it, which is why
typedErrors.html stays the section's overview page: it
names the feature by what it gives you, and the per-function pages hang
off it.
What about "Railway"?
Railway-oriented programming is a well-known metaphor for the same idea (a success track and a failure track). It is a fine mental model — and a poor page name: less searchable, not Arrow vocabulary, and a metaphor you must already know before it helps you.