churros-0.1.3.0: Channel/Arrow based streaming computation library.
Safe HaskellNone
LanguageHaskell2010

Control.Churro.Transport.Unagi.Bounded

Description

Unagi-Chan Bounded Transport Instance.

This makes use of a KnownNat parameter to specify the size of the buffer.

Synopsis

Documentation

Test Setup

>>> :set -XDataKinds
>>> import Control.Churro

data UnagiBounded n a Source #

Instances

Instances details
KnownNat n => Transport (UnagiBounded n :: Type -> Type) Source # 
Instance details

Defined in Control.Churro.Transport.Unagi.Bounded

Associated Types

data In (UnagiBounded n) :: Type -> Type Source #

data Out (UnagiBounded n) :: Type -> Type Source #

Methods

flex :: IO (In (UnagiBounded n) a, Out (UnagiBounded n) a) Source #

yank :: Out (UnagiBounded n) a -> IO a Source #

yeet :: In (UnagiBounded n) a -> a -> IO () Source #

data In (UnagiBounded n :: Type -> Type) a Source # 
Instance details

Defined in Control.Churro.Transport.Unagi.Bounded

data In (UnagiBounded n :: Type -> Type) a = ChanIn (InChan a)
data Out (UnagiBounded n :: Type -> Type) a Source # 
Instance details

Defined in Control.Churro.Transport.Unagi.Bounded

data Out (UnagiBounded n :: Type -> Type) a = ChanOut (OutChan a)

runWaitUnagi :: KnownNat n => ChurroUnagiBounded a n Void Void -> IO a Source #

Convenience function for running a Churro with a Bounded Unagi-Chan Transport.

runWaitListUnagi :: KnownNat n => ChurroUnagiBounded () n Void o -> IO [o] Source #

Convenience function for running a Churro into a List with a Bounded Unagi-Chan Transport.

>>> runWaitListUnagi @10 $ sourceList [1,2,3] >>> arr succ
[2,3,4]