{-# LANGUAGE RecordWildCards #-}
module FRP.Rhine.ResamplingBuffer.Timeless where
import Data.Stream.Result
import FRP.Rhine.ResamplingBuffer
data AsyncMealy m s a b = AsyncMealy
{ forall (m :: Type -> Type) s a b.
AsyncMealy m s a b -> s -> a -> m s
amPut :: s -> a -> m s
, forall (m :: Type -> Type) s a b.
AsyncMealy m s a b -> s -> m (Result s b)
amGet :: s -> m (Result s b)
}
timelessResamplingBuffer ::
(Monad m) =>
AsyncMealy m s a b ->
s ->
ResamplingBuffer m cl1 cl2 a b
timelessResamplingBuffer :: forall (m :: Type -> Type) s a b cl1 cl2.
Monad m =>
AsyncMealy m s a b -> s -> ResamplingBuffer m cl1 cl2 a b
timelessResamplingBuffer AsyncMealy {s -> m (Result s b)
s -> a -> m s
amPut :: forall (m :: Type -> Type) s a b.
AsyncMealy m s a b -> s -> a -> m s
amGet :: forall (m :: Type -> Type) s a b.
AsyncMealy m s a b -> s -> m (Result s b)
amPut :: s -> a -> m s
amGet :: s -> m (Result s b)
..} s
buffer = ResamplingBuffer {s
TimeInfo cl1 -> a -> s -> m s
TimeInfo cl2 -> s -> m (Result s b)
get :: TimeInfo cl2 -> s -> m (Result s b)
put :: TimeInfo cl1 -> a -> s -> m s
buffer :: s
put :: TimeInfo cl1 -> a -> s -> m s
get :: TimeInfo cl2 -> s -> m (Result s b)
buffer :: s
..}
where
put :: TimeInfo cl1 -> a -> s -> m s
put TimeInfo cl1
_ a
a s
s = s -> a -> m s
amPut s
s a
a
get :: TimeInfo cl2 -> s -> m (Result s b)
get TimeInfo cl2
_ = s -> m (Result s b)
amGet
trivialResamplingBuffer :: (Monad m) => ResamplingBuffer m cl1 cl2 () ()
trivialResamplingBuffer :: forall (m :: Type -> Type) cl1 cl2.
Monad m =>
ResamplingBuffer m cl1 cl2 () ()
trivialResamplingBuffer =
AsyncMealy m () () () -> () -> ResamplingBuffer m cl1 cl2 () ()
forall (m :: Type -> Type) s a b cl1 cl2.
Monad m =>
AsyncMealy m s a b -> s -> ResamplingBuffer m cl1 cl2 a b
timelessResamplingBuffer
AsyncMealy
{ amPut :: () -> () -> m ()
amPut = (() -> m ()) -> () -> () -> m ()
forall a b. a -> b -> a
const (m () -> () -> m ()
forall a b. a -> b -> a
const (() -> m ()
forall a. a -> m a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ()))
, amGet :: () -> m (Result () ())
amGet = m (Result () ()) -> () -> m (Result () ())
forall a b. a -> b -> a
const (Result () () -> m (Result () ())
forall a. a -> m a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Result () () -> m (Result () ()))
-> Result () () -> m (Result () ())
forall a b. (a -> b) -> a -> b
$! () -> () -> Result () ()
forall s a. s -> a -> Result s a
Result () ())
}
()