Copyright | (C) 2012 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
Mealy
machines
Examples
We can enumerate inputs:
>>>
let countingMealy = unfoldMealy (\i x -> ((i, x), i + 1)) 0
>>>
run (auto countingMealy <~ source "word")
[(0,'w'),(1,'o'),(2,'r'),(3,'d')]
Instances
Arrow Mealy Source # | |
ArrowChoice Mealy Source # | |
ArrowApply Mealy Source # | |
Defined in Data.Machine.Mealy | |
Profunctor Mealy Source # | |
Corepresentable Mealy Source # | |
Choice Mealy Source # | |
Closed Mealy Source # | |
Defined in Data.Machine.Mealy | |
Strong Mealy Source # | |
Costrong Mealy Source # | |
Automaton Mealy Source # | |
Cosieve Mealy NonEmpty Source # | |
Defined in Data.Machine.Mealy | |
Monad (Mealy a) Source # | slow diagonalization |
Functor (Mealy a) Source # | |
MonadFix (Mealy a) Source # | |
Defined in Data.Machine.Mealy | |
Applicative (Mealy a) Source # | |
Distributive (Mealy a) Source # | |
Representable (Mealy a) Source # | |
MonadZip (Mealy a) Source # | |
Pointed (Mealy a) Source # | |
Defined in Data.Machine.Mealy | |
Extend (Mealy a) Source # | |
Category Mealy Source # | |
MonadReader (NonEmpty a) (Mealy a) Source # | |
Semigroup b => Semigroup (Mealy a b) Source # | |
Monoid b => Monoid (Mealy a b) Source # | |
type Corep Mealy Source # | |
Defined in Data.Machine.Mealy | |
type Rep (Mealy a) Source # | |
Defined in Data.Machine.Mealy |
unfoldMealy :: (s -> a -> (b, s)) -> s -> Mealy a b Source #
A Mealy
machine modeled with explicit state.