machines-0.7.4: Networked stream transducers
Copyright(C) 2012 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <[email protected]>
Stabilityprovisional
PortabilityGADTs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Machine.Stack

Description

 
Synopsis

Documentation

data Stack a r where Source #

This is a simple process type that knows how to push back input.

Constructors

Push :: forall a. a -> Stack a () 
Pop :: forall a. Stack a a 

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

pop :: forall a b (m :: Type -> Type). PlanT (Stack a) b m a Source #

Pop the next value in the input stream

push :: a -> Plan (Stack a) b () Source #

Push back into the input stream