module Synthesizer.Dimensional.RatePhantom where
import qualified Synthesizer.Format as Format
import qualified Synthesizer.Dimensional.Abstraction.RateIndependent as Ind
newtype T s sig y = Cons {signal :: sig y}
instance Functor sig => Functor (T s sig) where
fmap f = fromSignal . fmap f . toSignal
instance (Format.C sig) => Format.C (T s sig) where
format p (Cons sig) =
showParen (p >= 10)
(showString "ratePhantom " . Format.format 11 sig)
instance (Format.C sig, Show y) => Show (T s sig y) where
showsPrec = Format.format
fromSignal :: sig y -> T s sig y
fromSignal = Cons
toSignal :: T s sig y -> sig y
toSignal = signal
processSignal :: (sig0 y0 -> sig1 y1) -> (T s sig0 y0 -> T s sig1 y1)
processSignal f = fromSignal . f . toSignal
instance Ind.C (T s) where
toSignal = signal
processSignal = processSignal