Copyright | (C) 2012 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <[email protected]> |
Stability | provisional |
Portability | GADTs |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Machine.Stack
Description
Synopsis
- data Stack a r where
- stack :: forall (m :: Type -> Type) (k :: Type -> Type) a o. Monad m => MachineT m k a -> MachineT m (Stack a) o -> MachineT m k o
- peek :: forall a b (m :: Type -> Type). PlanT (Stack a) b m a
- pop :: forall a b (m :: Type -> Type). PlanT (Stack a) b m a
- push :: a -> Plan (Stack a) b ()
Documentation
This is a simple process type that knows how to push back input.
stack :: forall (m :: Type -> Type) (k :: Type -> Type) a o. Monad m => MachineT m k a -> MachineT m (Stack a) o -> MachineT m k o Source #
Stream outputs from one Machine
into another with the possibility
of pushing inputs back.
peek :: forall a b (m :: Type -> Type). PlanT (Stack a) b m a Source #
Peek at the next value in the input stream without consuming it