Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
Wire sessions, i.e. running and/or testing wires.
- stepWire :: WireToGen >~ => Wire e >~ a b -> a >~ (Either e b, Wire e >~ a b)
- stepWireM :: Monad m => Wire e (Kleisli m) a b -> a -> m (Either e b, Wire e (Kleisli m) a b)
- testWire :: forall a e m (>~). (ArrowApply >~, ArrowKleisli m >~, MonadIO m, Show e, WireToGen >~) => Int -> (() >~ a) -> Wire e >~ a String >~ ()
- testWireM :: forall a e m. (Show e, MonadIO m) => Int -> m a -> Wire e (Kleisli m) a String -> m ()
- printInt :: (Num a, Ord a) => a -> a -> String -> IO a
- printRes :: String -> IO ()
- showRes :: Show e => Either e String -> String
- succMod :: (Num a, Ord a) => a -> a -> a
Running wires
Performs an instant of the given wire.
:: Monad m | |
=> Wire e (Kleisli m) a b | Wire to step. |
-> a | Input signal. |
-> m (Either e b, Wire e (Kleisli m) a b) |
Performs an instant of the given monad-based wire.
Testing wires
:: forall a e m (>~) . (ArrowApply >~, ArrowKleisli m >~, MonadIO m, Show e, WireToGen >~) | |
=> Int | Frames per output. Speed/accuracy tradeoff. |
-> (() >~ a) | Input generator. |
-> Wire e >~ a String >~ () |
Test a wire. This function runs the given wire continuously printing its output on a single line.
The first argument specifies how often the wire's result is printed. If you specify 100 here, then the output is printed at every 100th frame.
:: forall a e m . (Show e, MonadIO m) | |
=> Int | Frames per output. FPS/accuracy tradeoff. |
-> m a | Input generator. |
-> Wire e (Kleisli m) a String | |
-> m () |
Test a monad-based wire. This function runs the given wire continuously printing its output on a single line.
The first argument specifies how often the wire's result is printed. If you specify 100 here, then the output is printed at every 100th frame.