module Synthesizer.Dimensional.ChunkySize.Cut (
splitAt, take, drop,
) where
import qualified Synthesizer.Dimensional.Rate as Rate
import qualified Synthesizer.Dimensional.Amplitude as Amp
import qualified Synthesizer.Dimensional.Signal.Private as SigA
import qualified Synthesizer.ChunkySize as ChunkySize
import qualified Synthesizer.ChunkySize.Cut as CutC
import Prelude hiding (splitAt, take, drop, length, )
type Signal s amp sig =
SigA.T (Rate.Phantom s) amp sig
type Size s =
SigA.T (Rate.Phantom s) Amp.Abstract ChunkySize.T
splitAt :: (CutC.Transform sig) =>
Size s ->
Signal s amp sig ->
(Signal s amp sig, Signal s amp sig)
splitAt =
\t x ->
let (y,z) = CutC.splitAt (SigA.body t) $ SigA.body x
in (SigA.replaceBody y x,
SigA.replaceBody z x)
take :: (CutC.Transform sig) =>
Size s ->
Signal s amp sig ->
Signal s amp sig
take =
\t -> SigA.processBody (CutC.take (SigA.body t))
drop :: (CutC.Transform sig) =>
Size s ->
Signal s amp sig ->
Signal s amp sig
drop =
\t -> SigA.processBody (CutC.drop (SigA.body t))