Safe Haskell | None |
---|---|
Language | Haskell2010 |
Signals equipped with volume and sample rate information that may carry a unit. Kind of volume and sample rate is configurable by types.
- data T rate amplitude body
- type R s v y yv = T (Phantom s) (Dimensional v y) (T yv)
- asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> y
- render :: C u => T (Recip u) t -> (forall s. T s u t (T (Phantom s) amp sig)) -> T (Dimensional u t) amp sig
- apply :: C u => (forall s. T s u t (T (Phantom s) amp0 sig0 -> T (Phantom s) amp1 sig1)) -> T (Dimensional u t) amp0 sig0 -> T (Dimensional u t) amp1 sig1
- cache :: Storable yv => T rate amp (T yv) -> T rate amp (T yv)
- bindCached :: Storable yv => T s u t (T rate amp (T yv)) -> (T rate amp (T yv) -> T s u t b) -> T s u t b
- share :: Storable yv => T s u t (T rate amp (T yv)) -> (T s u t (T rate amp (T yv)) -> T s u t b) -> T s u t b
- store :: (C t, C u, Storable yv) => T u t -> T s u t (T (Phantom s) amp (T yv) -> T (Phantom s) amp (T yv))
- restore :: Read sig yv => T rate amp (sig yv) -> T rate amp (T yv)
- ($-) :: (C y, C y, C u, C v) => T s u t (R s v y y -> a) -> T v y -> T s u t a
- ($&) :: Applicative f => f (a -> b) -> f a -> f b
- (&*^) :: (C y flat, Transform sig y) => amp -> T s u t (T rate flat (sig y)) -> T s u t (T rate (Numeric amp) (sig y))
- (&*>^) :: amp -> T s u t (T rate (Flat y) sig) -> T s u t (T rate (Numeric amp) sig)
Documentation
data T rate amplitude body Source #
A signal value 0.5 at global amplitude 1 and signal value 1 at global amplitude 0.5 shall represent the same signal. Thus observing the amplitude breaks the abstraction.
Cyclic nature such as needed for Fourier transform
must be expressend in the body.
It would be nice to use the data type for waveforms, too,
but for waveforms the rate
parameter makes no sense.
asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> y Source #
render :: C u => T (Recip u) t -> (forall s. T s u t (T (Phantom s) amp sig)) -> T (Dimensional u t) amp sig Source #
apply :: C u => (forall s. T s u t (T (Phantom s) amp0 sig0 -> T (Phantom s) amp1 sig1)) -> T (Dimensional u t) amp0 sig0 -> T (Dimensional u t) amp1 sig1 Source #
bindCached :: Storable yv => T s u t (T rate amp (T yv)) -> (T rate amp (T yv) -> T s u t b) -> T s u t b Source #
share :: Storable yv => T s u t (T rate amp (T yv)) -> (T s u t (T rate amp (T yv)) -> T s u t b) -> T s u t b Source #
store :: (C t, C u, Storable yv) => T u t -> T s u t (T (Phantom s) amp (T yv) -> T (Phantom s) amp (T yv)) Source #
($-) :: (C y, C y, C u, C v) => T s u t (R s v y y -> a) -> T v y -> T s u t a infixl 0 Source #
Take a scalar argument where a process expects a signal. Only possible for non-negative values so far.
($&) :: Applicative f => f (a -> b) -> f a -> f b Source #