mealy-arrow

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.


Keywords
Control, Arrows
License
BSD-3-Clause
Install
cabal install mealy-arrow-0.1.0.0