mealy-arrow: Monadic Mealy machines with Arrow, ArrowChoice, and ArrowLoop
A monadic Mealy machine in the coalgebraic (continuation-passing)
representation:
.
newtype Auto m a b = Auto { step :: a -> m (b, Auto m a b) }
.
Each step consumes an input, produces an output in some monad m,
and returns the next state as a continuation. The monad parameter
controls the effect discipline: Identity for pure machines, IO
for effectful ones.
.
Instances: Category, Arrow, ArrowChoice, ArrowLoop,
Profunctor, Functor. Smart constructors: stateless, stateful,
constAuto. Natural transformation: hoistAuto.
.
== How is this different from the mealy package?
.
The Hackage package
mealy provides a pure,
existentially-quantified inject/step/extract triple designed for
online statistics (moving averages, regression). It has Category
and Profunctor instances but no Arrow, no ArrowChoice, no
ArrowLoop, and no monadic effects.
.
mealy-arrow provides the Nu (greatest fixpoint) representation
with full Arrow instances and a monad parameter. It is designed
for interactive systems: terminal UIs, protocol handlers,
game logic, API clients — anything where each step may have
effects and the machine's control flow may branch.
[Skip to Readme]
Downloads
- mealy-arrow-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.14 && <5), mealy-arrow, profunctors (>=5.0 && <6) [details] |
| Tested with | ghc ==9.10.3 |
| License | BSD-3-Clause |
| Author | mealy-arrow contributors |
| Maintainer | mealy-arrow contributors |
| Uploaded | by kaol at 2026-05-05T08:28:08Z |
| Category | Control, Arrows |
| Source repo | head: git clone https://github.com/mealy-arrow/mealy-arrow |
| Distributions | |
| Executables | mealy-arrow-example |
| Downloads | 3 total (3 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2026-05-05 [all 1 reports] |