{-# OPTIONS_HADDOCK hide, show-extensions #-}

module ForSyDe.Atom.MoC.DE.Hybrid where

import           ForSyDe.Atom.MoC
import qualified ForSyDe.Atom.MoC.DE.Core      as DE (Signal)
import qualified ForSyDe.Atom.MoC.DE.Interface as DE
import qualified ForSyDe.Atom.MoC.SY.Core      as SY (Signal)
import qualified ForSyDe.Atom.MoC.SY.Interface as SY
import           ForSyDe.Atom.Utility.Tuple

import qualified ForSyDe.Atom.MoC.SY.Lib

import Prelude hiding ((<>))

------- DOCTEST SETUP -------

-- $setup
-- >>> import ForSyDe.Atom.MoC.SY.Lib as SY
-- >>> import ForSyDe.Atom.MoC.DE.Core (readSignal, signal)

------- HYBRID PROCESSES -------

-- | Embeds a 'ForSyDe.Atom.MoC.SY.SY' process inside a
-- 'ForSyDe.Atom.MoC.DE.DE' environment. Internally, it synchronizes
-- the input signals, translates them to SY, feeds them to a SY
-- process and translates the result back to DE using the same input
-- tags. Seen from outside, this process behaves like a DE process
-- with "instantaneous response", even for feedback loops.
--
-- Constructors: @embedSY[1-4][1-4]@.
--
-- For the following example, see the difference between its output
-- and the one of 'ForSyDe.Atom.MoC.DE.stated22'
--
-- >>> let s = readSignal "{1@0, 2@2, 3@6, 4@8, 5@9}" :: DE.Signal Int
-- >>> embedSY11 (SY.stated11 (+) 1) s
-- {1@0s,2@2s,4@6s,7@8s,11@9s}
--
-- <<fig/moc-de-pattern-embedsy.png>>
embedSY22 :: (SY.Signal a1 -> SY.Signal a2
              -> (SY.Signal b1, SY.Signal b2))
          -- ^ 'ForSyDe.Atom.MoC.SY.SY' process
          -> DE.Signal a1 -- ^ first input DE signal
          -> DE.Signal a2 -- ^ second input DE signal 
          -> (DE.Signal b1, DE.Signal b2)
          -- ^ two output 'ForSyDe.Atom.MoC.DE.DE' signals

embedSY11 :: (Signal a -> Stream (SY a)) -> Stream (DE t a) -> Stream (DE t a)
embedSY11 syproc :: Signal a -> Stream (SY a)
syproc de1 :: Stream (DE t a)
de1 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1) = Stream (DE t a) -> (Signal t, Signal a)
forall t a.
(Num t, Ord t, Eq t) =>
SignalBase t a -> (Signal t, Signal a)
DE.toSY1 Stream (DE t a)
de1
                       in  Signal t -> Stream (SY a) -> Stream (DE t a)
forall (f :: * -> *) t a.
(Applicative f, Num t, Ord t) =>
f (SY t) -> f (SY a) -> f (DE t a)
SY.toDE Signal t
ts (Stream (SY a) -> Stream (DE t a))
-> Stream (SY a) -> Stream (DE t a)
forall a b. (a -> b) -> a -> b
$     Signal a -> Stream (SY a)
syproc Signal a
sy1 
embedSY12 :: (Signal a -> (Signal a, Signal b))
-> Stream (DE t a) -> (SignalBase t a, SignalBase t b)
embedSY12 syproc :: Signal a -> (Signal a, Signal b)
syproc de1 :: Stream (DE t a)
de1 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1) = Stream (DE t a) -> (Signal t, Signal a)
forall t a.
(Num t, Ord t, Eq t) =>
SignalBase t a -> (Signal t, Signal a)
DE.toSY1 Stream (DE t a)
de1
                       in  Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
forall t a b.
(Num t, Ord t, Eq t) =>
Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
SY.toDE2 Signal t
ts (Signal a -> Signal b -> (SignalBase t a, SignalBase t b))
-> (Signal a, Signal b) -> (SignalBase t a, SignalBase t b)
forall a1 a2 b1. (a1 -> a2 -> b1) -> (a1, a2) -> b1
><   Signal a -> (Signal a, Signal b)
syproc Signal a
sy1
embedSY13 :: (Signal a -> (Stream (SY a1), Stream (SY a2), Stream (SY a3)))
-> Stream (DE t a)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
embedSY13 syproc :: Signal a -> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc de1 :: Stream (DE t a)
de1 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1) = Stream (DE t a) -> (Signal t, Signal a)
forall t a.
(Num t, Ord t, Eq t) =>
SignalBase t a -> (Signal t, Signal a)
DE.toSY1 Stream (DE t a)
de1
                       in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall (f :: * -> *) t a1 a2 a3.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> (f (DE t a1), f (DE t a2), f (DE t a3))
SY.toDE3 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall t1 t2 t3 t4. (t1 -> t2 -> t3 -> t4) -> (t1, t2, t3) -> t4
><<  Signal a -> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc Signal a
sy1
embedSY14 :: (Signal a
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3),
     Stream (SY a4)))
-> Stream (DE t a)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
embedSY14 syproc :: Signal a
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc de1 :: Stream (DE t a)
de1 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1) = Stream (DE t a) -> (Signal t, Signal a)
forall t a.
(Num t, Ord t, Eq t) =>
SignalBase t a -> (Signal t, Signal a)
DE.toSY1 Stream (DE t a)
de1
                       in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> Stream (SY a4)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall (f :: * -> *) t a1 a2 a3 a4.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> f (SY a4)
-> (f (DE t a1), f (DE t a2), f (DE t a3), f (DE t a4))
SY.toDE4 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> Stream (SY a4)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
     Stream (DE t a4)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall t1 t2 t3 t4 t5.
(t1 -> t2 -> t3 -> t4 -> t5) -> (t1, t2, t3, t4) -> t5
><<< Signal a
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc Signal a
sy1

embedSY21 :: (Signal a -> Signal b -> Stream (SY a))
-> Stream (DE t a) -> Stream (DE t b) -> Stream (DE t a)
embedSY21 syproc :: Signal a -> Signal b -> Stream (SY a)
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2) = Stream (DE t a)
-> Stream (DE t b) -> (Signal t, Signal a, Signal b)
forall t a b.
(Num t, Ord t, Eq t) =>
SignalBase t a -> SignalBase t b -> (Signal t, Signal a, Signal b)
DE.toSY2 Stream (DE t a)
de1 Stream (DE t b)
de2
                           in  Signal t -> Stream (SY a) -> Stream (DE t a)
forall (f :: * -> *) t a.
(Applicative f, Num t, Ord t) =>
f (SY t) -> f (SY a) -> f (DE t a)
SY.toDE Signal t
ts (Stream (SY a) -> Stream (DE t a))
-> Stream (SY a) -> Stream (DE t a)
forall a b. (a -> b) -> a -> b
$     Signal a -> Signal b -> Stream (SY a)
syproc Signal a
sy1 Signal b
sy2
embedSY22 :: (Signal a1 -> Signal a2 -> (Signal b1, Signal b2))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
embedSY22 syproc :: Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
syproc de1 :: Signal a1
de1 de2 :: Signal a2
de2 = let (ts :: Signal TimeStamp
ts, sy1 :: Signal a1
sy1, sy2 :: Signal a2
sy2) = Signal a1 -> Signal a2 -> (Signal TimeStamp, Signal a1, Signal a2)
forall t a b.
(Num t, Ord t, Eq t) =>
SignalBase t a -> SignalBase t b -> (Signal t, Signal a, Signal b)
DE.toSY2 Signal a1
de1 Signal a2
de2
                           in  Signal TimeStamp
-> Signal b1 -> Signal b2 -> (Signal b1, Signal b2)
forall t a b.
(Num t, Ord t, Eq t) =>
Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
SY.toDE2 Signal TimeStamp
ts (Signal b1 -> Signal b2 -> (Signal b1, Signal b2))
-> (Signal b1, Signal b2) -> (Signal b1, Signal b2)
forall a1 a2 b1. (a1 -> a2 -> b1) -> (a1, a2) -> b1
><   Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
syproc Signal a1
sy1 Signal a2
sy2
embedSY23 :: (Signal a
 -> Signal b -> (Stream (SY a1), Stream (SY a2), Stream (SY a3)))
-> Stream (DE t a)
-> Stream (DE t b)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
embedSY23 syproc :: Signal a
-> Signal b -> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2) = Stream (DE t a)
-> Stream (DE t b) -> (Signal t, Signal a, Signal b)
forall t a b.
(Num t, Ord t, Eq t) =>
SignalBase t a -> SignalBase t b -> (Signal t, Signal a, Signal b)
DE.toSY2 Stream (DE t a)
de1 Stream (DE t b)
de2
                           in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall (f :: * -> *) t a1 a2 a3.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> (f (DE t a1), f (DE t a2), f (DE t a3))
SY.toDE3 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall t1 t2 t3 t4. (t1 -> t2 -> t3 -> t4) -> (t1, t2, t3) -> t4
><<  Signal a
-> Signal b -> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc Signal a
sy1 Signal b
sy2
embedSY24 :: (Signal a
 -> Signal b
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3),
     Stream (SY a4)))
-> Stream (DE t a)
-> Stream (DE t b)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
embedSY24 syproc :: Signal a
-> Signal b
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2) = Stream (DE t a)
-> Stream (DE t b) -> (Signal t, Signal a, Signal b)
forall t a b.
(Num t, Ord t, Eq t) =>
SignalBase t a -> SignalBase t b -> (Signal t, Signal a, Signal b)
DE.toSY2 Stream (DE t a)
de1 Stream (DE t b)
de2
                           in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> Stream (SY a4)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall (f :: * -> *) t a1 a2 a3 a4.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> f (SY a4)
-> (f (DE t a1), f (DE t a2), f (DE t a3), f (DE t a4))
SY.toDE4 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> Stream (SY a4)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
     Stream (DE t a4)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall t1 t2 t3 t4 t5.
(t1 -> t2 -> t3 -> t4 -> t5) -> (t1, t2, t3, t4) -> t5
><<< Signal a
-> Signal b
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc Signal a
sy1 Signal b
sy2

embedSY31 :: (Signal a -> Signal b -> Signal c -> Stream (SY a))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t a)
embedSY31 syproc :: Signal a -> Signal b -> Signal c -> Stream (SY a)
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Signal t, Signal a, Signal b, Signal c)
forall t a b c.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> (Signal t, Signal a, Signal b, Signal c)
DE.toSY3 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3
                               in  Signal t -> Stream (SY a) -> Stream (DE t a)
forall (f :: * -> *) t a.
(Applicative f, Num t, Ord t) =>
f (SY t) -> f (SY a) -> f (DE t a)
SY.toDE Signal t
ts (Stream (SY a) -> Stream (DE t a))
-> Stream (SY a) -> Stream (DE t a)
forall a b. (a -> b) -> a -> b
$     Signal a -> Signal b -> Signal c -> Stream (SY a)
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3
embedSY32 :: (Signal a -> Signal b -> Signal c -> (Signal a, Signal b))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (SignalBase t a, SignalBase t b)
embedSY32 syproc :: Signal a -> Signal b -> Signal c -> (Signal a, Signal b)
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Signal t, Signal a, Signal b, Signal c)
forall t a b c.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> (Signal t, Signal a, Signal b, Signal c)
DE.toSY3 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3
                               in  Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
forall t a b.
(Num t, Ord t, Eq t) =>
Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
SY.toDE2 Signal t
ts (Signal a -> Signal b -> (SignalBase t a, SignalBase t b))
-> (Signal a, Signal b) -> (SignalBase t a, SignalBase t b)
forall a1 a2 b1. (a1 -> a2 -> b1) -> (a1, a2) -> b1
><   Signal a -> Signal b -> Signal c -> (Signal a, Signal b)
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3
embedSY33 :: (Signal a
 -> Signal b
 -> Signal c
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3)))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
embedSY33 syproc :: Signal a
-> Signal b
-> Signal c
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Signal t, Signal a, Signal b, Signal c)
forall t a b c.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> (Signal t, Signal a, Signal b, Signal c)
DE.toSY3 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3
                               in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall (f :: * -> *) t a1 a2 a3.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> (f (DE t a1), f (DE t a2), f (DE t a3))
SY.toDE3 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall t1 t2 t3 t4. (t1 -> t2 -> t3 -> t4) -> (t1, t2, t3) -> t4
><<  Signal a
-> Signal b
-> Signal c
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3
embedSY34 :: (Signal a
 -> Signal b
 -> Signal c
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3),
     Stream (SY a4)))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
embedSY34 syproc :: Signal a
-> Signal b
-> Signal c
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> (Signal t, Signal a, Signal b, Signal c)
forall t a b c.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> (Signal t, Signal a, Signal b, Signal c)
DE.toSY3 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3
                               in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> Stream (SY a4)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall (f :: * -> *) t a1 a2 a3 a4.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> f (SY a4)
-> (f (DE t a1), f (DE t a2), f (DE t a3), f (DE t a4))
SY.toDE4 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> Stream (SY a4)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
     Stream (DE t a4)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall t1 t2 t3 t4 t5.
(t1 -> t2 -> t3 -> t4 -> t5) -> (t1, t2, t3, t4) -> t5
><<< Signal a
-> Signal b
-> Signal c
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3

embedSY41 :: (Signal a -> Signal b -> Signal c -> Signal d -> Stream (SY a))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> Stream (DE t a)
embedSY41 syproc :: Signal a -> Signal b -> Signal c -> Signal d -> Stream (SY a)
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 de4 :: Stream (DE t d)
de4 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3, sy4 :: Signal d
sy4) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
forall t a b c d.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> SignalBase t d
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
DE.toSY4 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3 Stream (DE t d)
de4
                                   in  Signal t -> Stream (SY a) -> Stream (DE t a)
forall (f :: * -> *) t a.
(Applicative f, Num t, Ord t) =>
f (SY t) -> f (SY a) -> f (DE t a)
SY.toDE Signal t
ts (Stream (SY a) -> Stream (DE t a))
-> Stream (SY a) -> Stream (DE t a)
forall a b. (a -> b) -> a -> b
$     Signal a -> Signal b -> Signal c -> Signal d -> Stream (SY a)
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3 Signal d
sy4
embedSY42 :: (Signal a
 -> Signal b -> Signal c -> Signal d -> (Signal a, Signal b))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (SignalBase t a, SignalBase t b)
embedSY42 syproc :: Signal a
-> Signal b -> Signal c -> Signal d -> (Signal a, Signal b)
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 de4 :: Stream (DE t d)
de4 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3, sy4 :: Signal d
sy4) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
forall t a b c d.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> SignalBase t d
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
DE.toSY4 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3 Stream (DE t d)
de4
                                   in  Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
forall t a b.
(Num t, Ord t, Eq t) =>
Signal t
-> Signal a -> Signal b -> (SignalBase t a, SignalBase t b)
SY.toDE2 Signal t
ts (Signal a -> Signal b -> (SignalBase t a, SignalBase t b))
-> (Signal a, Signal b) -> (SignalBase t a, SignalBase t b)
forall a1 a2 b1. (a1 -> a2 -> b1) -> (a1, a2) -> b1
><   Signal a
-> Signal b -> Signal c -> Signal d -> (Signal a, Signal b)
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3 Signal d
sy4
embedSY43 :: (Signal a
 -> Signal b
 -> Signal c
 -> Signal d
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3)))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
embedSY43 syproc :: Signal a
-> Signal b
-> Signal c
-> Signal d
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 de4 :: Stream (DE t d)
de4 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3, sy4 :: Signal d
sy4) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
forall t a b c d.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> SignalBase t d
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
DE.toSY4 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3 Stream (DE t d)
de4
                                   in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall (f :: * -> *) t a1 a2 a3.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> (f (DE t a1), f (DE t a2), f (DE t a3))
SY.toDE3 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3))
forall t1 t2 t3 t4. (t1 -> t2 -> t3 -> t4) -> (t1, t2, t3) -> t4
><<  Signal a
-> Signal b
-> Signal c
-> Signal d
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3))
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3 Signal d
sy4
embedSY44 :: (Signal a
 -> Signal b
 -> Signal c
 -> Signal d
 -> (Stream (SY a1), Stream (SY a2), Stream (SY a3),
     Stream (SY a4)))
-> Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
embedSY44 syproc :: Signal a
-> Signal b
-> Signal c
-> Signal d
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc de1 :: Stream (DE t a)
de1 de2 :: Stream (DE t b)
de2 de3 :: Stream (DE t c)
de3 de4 :: Stream (DE t d)
de4 = let (ts :: Signal t
ts, sy1 :: Signal a
sy1, sy2 :: Signal b
sy2, sy3 :: Signal c
sy3, sy4 :: Signal d
sy4) = Stream (DE t a)
-> Stream (DE t b)
-> Stream (DE t c)
-> Stream (DE t d)
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
forall t a b c d.
(Num t, Ord t, Eq t) =>
SignalBase t a
-> SignalBase t b
-> SignalBase t c
-> SignalBase t d
-> (Signal t, Signal a, Signal b, Signal c, Signal d)
DE.toSY4 Stream (DE t a)
de1 Stream (DE t b)
de2 Stream (DE t c)
de3 Stream (DE t d)
de4
                                   in  Signal t
-> Stream (SY a1)
-> Stream (SY a2)
-> Stream (SY a3)
-> Stream (SY a4)
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall (f :: * -> *) t a1 a2 a3 a4.
(Applicative f, Num t, Ord t) =>
f (SY t)
-> f (SY a1)
-> f (SY a2)
-> f (SY a3)
-> f (SY a4)
-> (f (DE t a1), f (DE t a2), f (DE t a3), f (DE t a4))
SY.toDE4 Signal t
ts (Stream (SY a1)
 -> Stream (SY a2)
 -> Stream (SY a3)
 -> Stream (SY a4)
 -> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
     Stream (DE t a4)))
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
-> (Stream (DE t a1), Stream (DE t a2), Stream (DE t a3),
    Stream (DE t a4))
forall t1 t2 t3 t4 t5.
(t1 -> t2 -> t3 -> t4 -> t5) -> (t1, t2, t3, t4) -> t5
><<< Signal a
-> Signal b
-> Signal c
-> Signal d
-> (Stream (SY a1), Stream (SY a2), Stream (SY a3), Stream (SY a4))
syproc Signal a
sy1 Signal b
sy2 Signal c
sy3 Signal d
sy4