| Copyright | (C) 2012 Edward Kmett |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Machine.Mealy
Description
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
Instances details
Instance details
Defined in Data.Machine.Mealy
Instance details
Defined in Data.Machine.Mealy
Methods
dimap :: (a -> b) -> (c -> d) -> Mealy b c -> Mealy a d #
lmap :: (a -> b) -> Mealy b c -> Mealy a c #
rmap :: (b -> c) -> Mealy a b -> Mealy a c #
(#.) :: forall a b c q. Coercible c b => q b c -> Mealy a b -> Mealy a c #
(.#) :: forall a b c q. Coercible b a => Mealy b c -> q a b -> Mealy a c #
Instance details
Defined in Data.Machine.Mealy
unfoldMealy :: (s -> a -> (b, s)) -> s -> Mealy a b Source #
A Mealy machine modeled with explicit state.