{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  ForSyDe.MoC.SY.Lib
-- Copyright   :  (c) George Ungureanu, KTH/ICT/E 2015-2016
-- License     :  BSD-style (see the file LICENSE)
--
-- Maintainer  :  ugeorge@kth.se
-- Stability   :  experimental
-- Portability :  portable
--
-- This module provides a set of helpers for properly instantiating
-- process network patterns as process constructors.
--
-----------------------------------------------------------------------------
module ForSyDe.Atom.MoC.SY.Lib where


import qualified ForSyDe.Atom.ExB as B
import           ForSyDe.Atom.ExB.Absent (AbstExt(..))
import qualified ForSyDe.Atom.MoC as MoC
import           ForSyDe.Atom.MoC.SY.Core
import           Prelude hiding (filter)


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

-- $setup
-- >>> import ForSyDe.Atom.MoC.Stream (takeS)

------- DELAY -------

-- | The @delay@ process "delays" a signal with one
-- event. Instantiates the 'ForSyDe.Atom.MoC.delay' pattern.
--
-- >>> let s = signal [1,2,3,4,5]
-- >>> delay 0 s
-- {0,1,2,3,4,5}
--
-- <<fig/moc-sy-pattern-delay.png>>
delay :: a     -- ^ initial value
      -> Signal a -- ^ input signal
      -> Signal a -- ^ output signal
delay :: a -> Signal a -> Signal a
delay i :: a
i = Signal a -> Signal a -> Signal a
forall (e :: * -> *) a.
MoC e =>
Stream (e a) -> Stream (e a) -> Stream (e a)
MoC.delay (a -> Signal a
forall a. a -> Signal a
unit a
i)

------- COMB -------

-- | @comb@ processes map combinatorial functions on signals and take care of
-- synchronization between input signals. It implements the @comb@ pattern (see
-- 'ForSyDe.Atom.MoC.comb22').
-- 
-- Constructors: @comb[1-4][1-4]@.
--
-- >>> let s1 = signal [1..]
-- >>> let s2 = signal [1,1,1,1,1]
-- >>> comb11 (+1) s2
-- {2,2,2,2,2}
-- >>> comb22 (\a b-> (a+b,a-b)) s1 s2
-- ({2,3,4,5,6},{0,1,2,3,4})
--
-- <<fig/moc-sy-pattern-comb.png>>
comb22 :: (a1 -> a2 -> (b1, b2)) -- ^ function on values
       -> Signal a1              -- ^ first input signal
       -> Signal a2              -- ^ second input signal
       -> (Signal b1, Signal b2) -- ^ two output signals
comb11 :: (a1 -> b1)
       -> Signal a1 -> Signal b1
comb12 :: (a1 -> (b1, b2))
       -> Signal a1 -> (Signal b1, Signal b2)
comb13 :: (a1 -> (b1, b2, b3))
       -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
comb14 :: (a1 -> (b1, b2, b3, b4))
       -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
comb21 :: (a1 -> a2 -> b1)
       -> Signal a1 -> Signal a2 -> Signal b1
comb23 :: (a1 -> a2 -> (b1, b2, b3))
       -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
comb24 :: (a1 -> a2 -> (b1, b2, b3, b4))
       -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
comb31 :: (a1 -> a2 -> a3 -> b1)
       -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
comb32 :: (a1 -> a2 -> a3 -> (b1, b2))
       -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
comb33 :: (a1 -> a2 -> a3 -> (b1, b2, b3))
       -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
comb34 :: (a1 -> a2 -> a3 -> (b1, b2, b3, b4))
       -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
comb41 :: (a1 -> a2 -> a3 -> a4 -> b1)
       -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
comb42 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2))
       -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
comb43 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
       -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
comb44 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
       -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

comb11 :: (a1 -> b1) -> Signal a1 -> Signal b1
comb11 = (a1 -> b1) -> Signal a1 -> Signal b1
forall (e :: * -> *) a b.
MoC e =>
Fun e a (Ret e b) -> Stream (e a) -> Stream (e b)
MoC.comb11 
comb12 :: (a1 -> (b1, b2)) -> Signal a1 -> (Signal b1, Signal b2)
comb12 = (a1 -> (b1, b2)) -> Signal a1 -> (Signal b1, Signal b2)
forall (e :: * -> *) a b1 b2.
MoC e =>
Fun e a (Ret e b1, Ret e b2)
-> Stream (e a) -> (Stream (e b1), Stream (e b2))
MoC.comb12 
comb13 :: (a1 -> (b1, b2, b3))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3)
comb13 = (a1 -> (b1, b2, b3))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a b1 b2 b3.
MoC e =>
Fun e a (Ret e b1, Ret e b2, Ret e b3)
-> Stream (e a) -> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.comb13 
comb14 :: (a1 -> (b1, b2, b3, b4))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
comb14 = (a1 -> (b1, b2, b3, b4))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a b1 b2 b3 b4.
MoC e =>
Fun e a (Ret e b1, Ret e b2, Ret e b3, Ret e b4)
-> Stream (e a)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.comb14 
comb21 :: (a1 -> a2 -> b1) -> Signal a1 -> Signal a2 -> Signal b1
comb21 = (a1 -> a2 -> b1) -> Signal a1 -> Signal a2 -> Signal b1
forall (e :: * -> *) a1 a2 b.
MoC e =>
Fun e a1 (Fun e a2 (Ret e b))
-> Stream (e a1) -> Stream (e a2) -> Stream (e b)
MoC.comb21 
comb22 :: (a1 -> a2 -> (b1, b2))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
comb22 = (a1 -> a2 -> (b1, b2))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e b1, Ret e b2))
-> Stream (e a1) -> Stream (e a2) -> (Stream (e b1), Stream (e b2))
MoC.comb22 
comb23 :: (a1 -> a2 -> (b1, b2, b3))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
comb23 = (a1 -> a2 -> (b1, b2, b3))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.comb23 
comb24 :: (a1 -> a2 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
comb24 = (a1 -> a2 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.comb24 
comb31 :: (a1 -> a2 -> a3 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
comb31 = (a1 -> a2 -> a3 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
forall (e :: * -> *) a1 a2 a3 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e b)))
-> Stream (e a1) -> Stream (e a2) -> Stream (e a3) -> Stream (e b)
MoC.comb31 
comb32 :: (a1 -> a2 -> a3 -> (b1, b2))
-> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
comb32 = (a1 -> a2 -> a3 -> (b1, b2))
-> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2))
MoC.comb32 
comb33 :: (a1 -> a2 -> a3 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
comb33 = (a1 -> a2 -> a3 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.comb33 
comb34 :: (a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
comb34 = (a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3 b4.
MoC e =>
Fun
  e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.comb34 
comb41 :: (a1 -> a2 -> a3 -> a4 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
comb41 = (a1 -> a2 -> a3 -> a4 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e b)
MoC.comb41 
comb42 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
comb42 = (a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2))
MoC.comb42 
comb43 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
comb43 = (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3.
MoC e =>
Fun
  e
  a1
  (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.comb43 
comb44 :: (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
comb44 = (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3 b4.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.comb44 

------- RECONFIG -------

-- | @reconfig@ creates an synchronous adaptive process where the first signal carries
-- functions and the other carry the arguments. It imlements the @reconfig@ pattern
-- (see 'ForSyDe.Atom.MoC.reconfig22').
--
-- Constructors: @reconfig[1-4][1-4]@.
--
-- >>> let sf = signal [(+1),(*2),(+1),(*2),(+1),(*2),(+1)] 
-- >>> let s1 = signal [1..]
-- >>> reconfig11 sf s1
-- {2,4,4,8,6,12,8}
--
-- <<fig/moc-sy-pattern-reconfig.png>>
reconfig22 :: Signal (a1 -> a2 -> (b1, b2))
           -- ^ signal carrying functions
           -> Signal a1
           -- ^ first input signal carrying arguments
           -> Signal a2
           -- ^ second input signal carrying arguments
           -> (Signal b1, Signal b2) -- ^ two output signals
reconfig11 :: Signal (a1 -> b1)
           -> Signal a1 -> Signal b1
reconfig12 :: Signal(a1 -> (b1, b2))
           -> Signal a1 -> (Signal b1, Signal b2)
reconfig13 :: Signal(a1 -> (b1, b2, b3))
           -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
reconfig14 :: Signal(a1 -> (b1, b2, b3, b4))
           -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig21 :: Signal(a1 -> a2 -> b1)
           -> Signal a1 -> Signal a2 -> Signal b1
reconfig23 :: Signal(a1 -> a2 -> (b1, b2, b3))
           -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
reconfig24 :: Signal(a1 -> a2 -> (b1, b2, b3, b4))
           -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig31 :: Signal(a1 -> a2 -> a3 -> b1)
           -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
reconfig32 :: Signal(a1 -> a2 -> a3 -> (b1, b2))
           -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
reconfig33 :: Signal(a1 -> a2 -> a3 -> (b1, b2, b3))
           -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
reconfig34 :: Signal(a1 -> a2 -> a3 -> (b1, b2, b3, b4))
           -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig41 :: Signal(a1 -> a2 -> a3 -> a4 -> b1)
           -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
reconfig42 :: Signal(a1 -> a2 -> a3 -> a4 -> (b1, b2))
           -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
reconfig43 :: Signal(a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
           -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
reconfig44 :: Signal(a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
           -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

reconfig11 :: Signal (a1 -> b1) -> Signal a1 -> Signal b1
reconfig11 = Signal (a1 -> b1) -> Signal a1 -> Signal b1
forall (e :: * -> *) a b.
MoC e =>
Stream (e (Fun e a (Ret e b))) -> Stream (e a) -> Stream (e b)
MoC.reconfig11 
reconfig12 :: Signal (a1 -> (b1, b2)) -> Signal a1 -> (Signal b1, Signal b2)
reconfig12 = Signal (a1 -> (b1, b2)) -> Signal a1 -> (Signal b1, Signal b2)
forall (e :: * -> *) a b1 b2.
MoC e =>
Stream (e (Fun e a (Ret e b1, Ret e b2)))
-> Stream (e a) -> (Stream (e b1), Stream (e b2))
MoC.reconfig12 
reconfig13 :: Signal (a1 -> (b1, b2, b3))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3)
reconfig13 = Signal (a1 -> (b1, b2, b3))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a b1 b2 b3.
MoC e =>
Stream (e (Fun e a (Ret e b1, Ret e b2, Ret e b3)))
-> Stream (e a) -> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.reconfig13 
reconfig14 :: Signal (a1 -> (b1, b2, b3, b4))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig14 = Signal (a1 -> (b1, b2, b3, b4))
-> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a b1 b2 b3 b4.
MoC e =>
Stream (e (Fun e a (Ret e b1, Ret e b2, Ret e b3, Ret e b4)))
-> Stream (e a)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.reconfig14 
reconfig21 :: Signal (a1 -> a2 -> b1) -> Signal a1 -> Signal a2 -> Signal b1
reconfig21 = Signal (a1 -> a2 -> b1) -> Signal a1 -> Signal a2 -> Signal b1
forall (e :: * -> *) a1 a2 b.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Ret e b))))
-> Stream (e a1) -> Stream (e a2) -> Stream (e b)
MoC.reconfig21 
reconfig22 :: Signal (a1 -> a2 -> (b1, b2))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
reconfig22 = Signal (a1 -> a2 -> (b1, b2))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 b1 b2.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Ret e b1, Ret e b2))))
-> Stream (e a1) -> Stream (e a2) -> (Stream (e b1), Stream (e b2))
MoC.reconfig22 
reconfig23 :: Signal (a1 -> a2 -> (b1, b2, b3))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
reconfig23 = Signal (a1 -> a2 -> (b1, b2, b3))
-> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 b1 b2 b3.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3))))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.reconfig23 
reconfig24 :: Signal (a1 -> a2 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig24 = Signal (a1 -> a2 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 b1 b2 b3 b4.
MoC e =>
Stream
  (e (Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.reconfig24 
reconfig31 :: Signal (a1 -> a2 -> a3 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
reconfig31 = Signal (a1 -> a2 -> a3 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
forall (e :: * -> *) a1 a2 a3 b.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Fun e a3 (Ret e b)))))
-> Stream (e a1) -> Stream (e a2) -> Stream (e a3) -> Stream (e b)
MoC.reconfig31 
reconfig32 :: Signal (a1 -> a2 -> a3 -> (b1, b2))
-> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
reconfig32 = Signal (a1 -> a2 -> a3 -> (b1, b2))
-> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 b1 b2.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2))
MoC.reconfig32 
reconfig33 :: Signal (a1 -> a2 -> a3 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
reconfig33 = Signal (a1 -> a2 -> a3 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3.
MoC e =>
Stream
  (e (Fun e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.reconfig33 
reconfig34 :: Signal (a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig34 = Signal (a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3 b4.
MoC e =>
Stream
  (e (Fun
        e
        a1
        (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.reconfig34 
reconfig41 :: Signal (a1 -> a2 -> a3 -> a4 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
reconfig41 = Signal (a1 -> a2 -> a3 -> a4 -> b1)
-> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 b.
MoC e =>
Stream (e (Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b))))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e b)
MoC.reconfig41 
reconfig42 :: Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
reconfig42 = Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2.
MoC e =>
Stream
  (e (Fun
        e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2))))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2))
MoC.reconfig42 
reconfig43 :: Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
reconfig43 = Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3.
MoC e =>
Stream
  (e (Fun
        e
        a1
        (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3))))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.reconfig43 
reconfig44 :: Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
reconfig44 = Signal (a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3 b4.
MoC e =>
Stream
  (e (Fun
        e
        a1
        (Fun
           e
           a2
           (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.reconfig44 

------- CONSTANT -------

-- | A signal generator which keeps a value constant. It implements rgw @stated0X@
-- pattern (see 'ForSyDe.Atom.MoC.stated22').
--
-- Constructors: @constant[1-4]@.
--
-- >>> let (s1, s2) = constant2 (1,2)
-- >>> takeS 3 s1
-- {1,1,1}
-- >>> takeS 5 s2
-- {2,2,2,2,2}
--
-- <<fig/moc-sy-pattern-constant.png>>
constant2 :: (b1, b2)               -- ^ values to be repeated
          -> (Signal b1, Signal b2) -- ^ generated signals
constant1 :: b1 -> Signal b1
constant3 :: (b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
constant4 :: (b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)

constant1 :: b1 -> Signal b1
constant1 i :: b1
i = Fun SY b1 (Ret SY b1) -> Signal b1 -> Signal b1
forall (e :: * -> *) a.
MoC e =>
Fun e a (Ret e a) -> Stream (e a) -> Stream (e a)
MoC.stated01 Fun SY b1 (Ret SY b1)
forall a. a -> a
id (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
constant2 :: (b1, b2) -> (Signal b1, Signal b2)
constant2 i :: (b1, b2)
i = Fun SY b1 (Fun SY b2 (Ret SY b1, Ret SY b2))
-> (Signal b1, Signal b2) -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1, Ret e a2))
-> (Stream (e a1), Stream (e a2)) -> (Stream (e a1), Stream (e a2))
MoC.stated02 (,) ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
constant3 :: (b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
constant3 i :: (b1, b2, b3)
i = Fun SY b1 (Fun SY b2 (Fun SY b3 (Ret SY b1, Ret SY b2, Ret SY b3)))
-> (Signal b1, Signal b2, Signal b3)
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1, Ret e a2, Ret e a3)))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated03 (,,) ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
constant4 :: (b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
constant4 i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY b4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated04 (,,,) ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)


------- GENERATE -------

-- | A signal generator based on a function and a kernel value. It implements the
-- @stated0X@ pattern (check 'ForSyDe.Atom.MoC.stated22').
--
-- Constructors: @generate[1-4]@.
--
-- >>> let (s1,s2) = generate2 (\a b -> (a+1,b+2)) (1,2)  
-- >>> takeS 5 s1
-- {1,2,3,4,5}
-- >>> takeS 7 s2
-- {2,4,6,8,10,12,14}
--
-- <<fig/moc-sy-pattern-generate.png>>
generate2 :: (b1 -> b2 -> (b1, b2))
             -- ^ function to generate next value
             -> (b1, b2)
             -- ^ kernel values
             -> (Signal b1, Signal b2) -- ^ generated signals
generate1 :: (b1 -> b1) -> b1
          -> Signal b1
generate3 :: (b1 -> b2 -> b3 -> (b1, b2, b3)) -> (b1, b2, b3)
          -> (Signal b1, Signal b2, Signal b3)
generate4 :: (b1 -> b2 -> b3 -> b4 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
          -> (Signal b1, Signal b2, Signal b3, Signal b4)

generate1 :: (b1 -> b1) -> b1 -> Signal b1
generate1 ns :: b1 -> b1
ns i :: b1
i = Fun SY b1 (Ret SY b1) -> Signal b1 -> Signal b1
forall (e :: * -> *) a.
MoC e =>
Fun e a (Ret e a) -> Stream (e a) -> Stream (e a)
MoC.stated01 Fun SY b1 (Ret SY b1)
b1 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
generate2 :: (b1 -> b2 -> (b1, b2)) -> (b1, b2) -> (Signal b1, Signal b2)
generate2 ns :: b1 -> b2 -> (b1, b2)
ns i :: (b1, b2)
i = Fun SY b1 (Fun SY b2 (Ret SY b1, Ret SY b2))
-> (Signal b1, Signal b2) -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1, Ret e a2))
-> (Stream (e a1), Stream (e a2)) -> (Stream (e a1), Stream (e a2))
MoC.stated02 Fun SY b1 (Fun SY b2 (Ret SY b1, Ret SY b2))
b1 -> b2 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
generate3 :: (b1 -> b2 -> b3 -> (b1, b2, b3))
-> (b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
generate3 ns :: b1 -> b2 -> b3 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun SY b1 (Fun SY b2 (Fun SY b3 (Ret SY b1, Ret SY b2, Ret SY b3)))
-> (Signal b1, Signal b2, Signal b3)
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1, Ret e a2, Ret e a3)))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated03 Fun SY b1 (Fun SY b2 (Fun SY b3 (Ret SY b1, Ret SY b2, Ret SY b3)))
b1 -> b2 -> b3 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
generate4 :: (b1 -> b2 -> b3 -> b4 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
generate4 ns :: b1 -> b2 -> b3 -> b4 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY b4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated04 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY b4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))
b1 -> b2 -> b3 -> b4 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)


------- STATED -------

-- | @stated@ is a state machine without an output decoder. It implements the @stated@
-- pattern (see 'ForSyDe.Atom.MoC.stated22').
--
-- Constructors: @stated[1-4][1-4]@.
--
-- >>> let s1 = signal [1,2,3,4,5]  
-- >>> stated11 (+) 1 s1
-- {1,2,4,7,11,16}
--
-- <<fig/moc-sy-pattern-stated.png>>
stated22 :: (b1 -> b2 -> a1 -> a2 -> (b1, b2))
            -- ^ next state function
            -> (b1, b2)
            -- ^ initial state values
            -> Signal a1
            -- ^ first input signal
            -> Signal a2
            -- ^ second input signal
            -> (Signal b1, Signal b2) -- ^ output signals
stated11 :: (b1 -> a1 -> b1) -> b1
        -> Signal a1 -> Signal b1
stated12 :: (b1 -> b2 -> a1 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> (Signal b1, Signal b2)
stated13 :: (b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
stated14 :: (b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
stated21 :: (b1 -> a1 -> a2 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal b1
stated23 :: (b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
stated24 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
stated31 :: (b1 -> a1 -> a2 -> a3 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
stated32 :: (b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
stated33 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
stated34 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
stated41 :: (b1 -> a1 -> a2 -> a3 -> a4 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
stated42 :: (b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
stated43 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
stated44 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

stated11 :: (b1 -> a1 -> b1) -> b1 -> Signal a1 -> Signal b1
stated11 ns :: b1 -> a1 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Ret SY b1))
-> Signal b1 -> Signal a1 -> Signal b1
forall (e :: * -> *) a1 a2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Stream (e a1) -> Stream (e a2) -> Stream (e a1)
MoC.stated11 Fun SY b1 (Fun SY a1 (Ret SY b1))
b1 -> a1 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
stated12 :: (b1 -> b2 -> a1 -> (b1, b2))
-> (b1, b2) -> Signal a1 -> (Signal b1, Signal b2)
stated12 ns :: b1 -> b2 -> a1 -> (b1, b2)
ns i :: (b1, b2)
i = Fun SY b1 (Fun SY b2 (Fun SY a1 (Ret SY b1, Ret SY b2)))
-> (Signal b1, Signal b2) -> Signal a1 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1, Ret e a2)))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> (Stream (e a1), Stream (e a2))
MoC.stated12 Fun SY b1 (Fun SY b2 (Fun SY a1 (Ret SY b1, Ret SY b2)))
b1 -> b2 -> a1 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
stated13 :: (b1 -> b2 -> b3 -> a1 -> (b1, b2, b3))
-> (b1, b2, b3) -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
stated13 ns :: b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY b3 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4.
MoC e =>
Fun
  e
  a1
  (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1, Ret e a2, Ret e a3))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated13 Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY b3 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))))
b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
stated14 :: (b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
stated14 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY b4 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2, Ret e a3, Ret e a4)))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated14 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY b4 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
stated21 :: (b1 -> a1 -> a2 -> b1) -> b1 -> Signal a1 -> Signal a2 -> Signal b1
stated21 ns :: b1 -> a1 -> a2 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Fun SY a2 (Ret SY b1)))
-> Signal b1 -> Signal a1 -> Signal a2 -> Signal b1
forall (e :: * -> *) a1 a2 a3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Stream (e a1) -> Stream (e a2) -> Stream (e a3) -> Stream (e a1)
MoC.stated21 Fun SY b1 (Fun SY a1 (Fun SY a2 (Ret SY b1)))
b1 -> a1 -> a2 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
stated22 :: (b1 -> b2 -> a1 -> a2 -> (b1, b2))
-> (b1, b2) -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
stated22 ns :: b1 -> b2 -> a1 -> a2 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY b1 (Fun SY b2 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
forall (e :: * -> *) st1 st2 a1 a2.
MoC e =>
Fun e st1 (Fun e st2 (Fun e a1 (Fun e a2 (Ret e st1, Ret e st2))))
-> (Stream (e st1), Stream (e st2))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e st1), Stream (e st2))
MoC.stated22 Fun
  SY b1 (Fun SY b2 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2))))
b1 -> b2 -> a1 -> a2 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
stated23 :: (b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
stated23 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2, Ret e a3)))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated23 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))))
b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
stated24 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
stated24 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated24 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
stated31 :: (b1 -> a1 -> a2 -> a3 -> b1)
-> b1 -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
stated31 ns :: b1 -> a1 -> a2 -> a3 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
-> Signal b1 -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
forall (e :: * -> *) a1 a2 a3 a4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a1)
MoC.stated31 Fun SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
b1 -> a1 -> a2 -> a3 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
stated32 :: (b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2))
-> (b1, b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
stated32 ns :: b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2)))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2)))))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2))
MoC.stated32 Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2)))))
b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
stated33 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
stated33 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun e a4 (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2, Ret e a3))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated33 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))))
b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
stated34 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
stated34 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun
              e
              a5
              (Fun e a6 (Fun e a7 (Ret e a1, Ret e a2, Ret e a3, Ret e a4)))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated34 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
stated41 :: (b1 -> a1 -> a2 -> a3 -> a4 -> b1)
-> b1
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
stated41 ns :: b1 -> a1 -> a2 -> a3 -> a4 -> b1
ns i :: b1
i = Fun
  SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
-> Signal b1
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a1)
MoC.stated41 Fun
  SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
b1 -> a1 -> a2 -> a3 -> a4 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
stated42 :: (b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> (b1, b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
stated42 ns :: b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2))))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2))))))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2))
MoC.stated42 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2))))))
b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
stated43 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
stated43 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           a1
           (Fun
              SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun e a5 (Fun e a6 (Fun e a7 (Ret e a1, Ret e a2, Ret e a3)))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.stated43 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           a1
           (Fun
              SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))))
b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
stated44 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
stated44 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY
                 a2
                 (Fun
                    SY
                    a3
                    (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7 a8.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun
              e
              a5
              (Fun
                 e
                 a6
                 (Fun e a7 (Fun e a8 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> Stream (e a8)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.stated44 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY
                 a2
                 (Fun
                    SY
                    a3
                    (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)


------- STATE -------
                 
-- | @state@ is a state machine without an output decoder. It implements the @stated@
-- pattern (see 'ForSyDe.Atom.MoC.state22').
--
-- Constructors: @state[1-4][1-4]@.
--
-- >>> let s1 = signal [1,2,3,4,5]  
-- >>> state11 (+) 1 s1
-- {2,4,7,11,16}
--
-- <<fig/moc-sy-pattern-state.png>>
state22 :: (b1 -> b2 -> a1 -> a2 -> (b1, b2))
           -- ^ next state function
           -> (b1, b2)
           -- ^ initial state values
           -> Signal a1
           -- ^ first input signal
           -> Signal a2
           -- ^ second input signal
           -> (Signal b1, Signal b2) -- ^ output signals
state11 :: (b1 -> a1 -> b1) -> b1
        -> Signal a1 -> Signal b1
state12 :: (b1 -> b2 -> a1 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> (Signal b1, Signal b2)
state13 :: (b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
state14 :: (b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
state21 :: (b1 -> a1 -> a2 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal b1
state23 :: (b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
state24 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
state31 :: (b1 -> a1 -> a2 -> a3 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
state32 :: (b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
state33 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
state34 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
state41 :: (b1 -> a1 -> a2 -> a3 -> a4 -> b1) -> b1
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
state42 :: (b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)) -> (b1, b2)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
state43 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)) -> (b1, b2, b3)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
state44 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)) -> (b1, b2, b3, b4)
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

state11 :: (b1 -> a1 -> b1) -> b1 -> Signal a1 -> Signal b1
state11 ns :: b1 -> a1 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Ret SY b1))
-> Signal b1 -> Signal a1 -> Signal b1
forall (e :: * -> *) a1 a2 b.
(MoC e,
 Fun e a1 (Fun e a2 (Ret e a1)) ~ Fun e a1 (Fun e a2 (Ret e b))) =>
Fun e a1 (Fun e a2 (Ret e b))
-> Stream (e a1) -> Stream (e a2) -> Stream (e b)
MoC.state11 Fun SY b1 (Fun SY a1 (Ret SY b1))
b1 -> a1 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
state12 :: (b1 -> b2 -> a1 -> (b1, b2))
-> (b1, b2) -> Signal a1 -> (Signal b1, Signal b2)
state12 ns :: b1 -> b2 -> a1 -> (b1, b2)
ns i :: (b1, b2)
i = Fun SY b1 (Fun SY b2 (Fun SY a1 (Ret SY b1, Ret SY b2)))
-> (Signal b1, Signal b2) -> Signal a1 -> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1, Ret e a2)))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> (Stream (e a1), Stream (e a2))
MoC.state12 Fun SY b1 (Fun SY b2 (Fun SY a1 (Ret SY b1, Ret SY b2)))
b1 -> b2 -> a1 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
state13 :: (b1 -> b2 -> b3 -> a1 -> (b1, b2, b3))
-> (b1, b2, b3) -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
state13 ns :: b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY b3 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4.
MoC e =>
Fun
  e
  a1
  (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1, Ret e a2, Ret e a3))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.state13 Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY b3 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))))
b1 -> b2 -> b3 -> a1 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
state14 :: (b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
state14 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY b4 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2, Ret e a3, Ret e a4)))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.state14 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY b4 (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
b1 -> b2 -> b3 -> b4 -> a1 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
state21 :: (b1 -> a1 -> a2 -> b1) -> b1 -> Signal a1 -> Signal a2 -> Signal b1
state21 ns :: b1 -> a1 -> a2 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Fun SY a2 (Ret SY b1)))
-> Signal b1 -> Signal a1 -> Signal a2 -> Signal b1
forall (e :: * -> *) a1 a2 a3 b.
(MoC e,
 Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
 ~ Fun e a1 (Fun e a2 (Fun e a3 (Ret e b)))) =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e b)))
-> Stream (e a1) -> Stream (e a2) -> Stream (e a3) -> Stream (e b)
MoC.state21 Fun SY b1 (Fun SY a1 (Fun SY a2 (Ret SY b1)))
b1 -> a1 -> a2 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
state22 :: (b1 -> b2 -> a1 -> a2 -> (b1, b2))
-> (b1, b2) -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
state22 ns :: b1 -> b2 -> a1 -> a2 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY b1 (Fun SY b2 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
forall (e :: * -> *) st1 st2 a1 a2.
MoC e =>
Fun e st1 (Fun e st2 (Fun e a1 (Fun e a2 (Ret e st1, Ret e st2))))
-> (Stream (e st1), Stream (e st2))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e st1), Stream (e st2))
MoC.state22 Fun
  SY b1 (Fun SY b2 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2))))
b1 -> b2 -> a1 -> a2 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
state23 :: (b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
state23 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2, Ret e a3)))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.state23 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY b3 (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))))
b1 -> b2 -> b3 -> a1 -> a2 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
state24 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
state24 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.state24 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
state31 :: (b1 -> a1 -> a2 -> a3 -> b1)
-> b1 -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
state31 ns :: b1 -> a1 -> a2 -> a3 -> b1
ns i :: b1
i = Fun SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
-> Signal b1 -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 b.
(MoC e,
 Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
 ~ Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b))))) =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e b)
MoC.state31 Fun SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
b1 -> a1 -> a2 -> a3 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
state32 :: (b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2))
-> (b1, b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
state32 ns :: b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2)))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5.
MoC e =>
Fun
  e
  a1
  (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1, Ret e a2)))))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e a1), Stream (e a2))
MoC.state32 Fun
  SY
  b1
  (Fun
     SY b2 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2)))))
b1 -> b2 -> a1 -> a2 -> a3 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
state33 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
state33 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun e a4 (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2, Ret e a3))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.state33 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))))
b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
state34 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
state34 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun
              e
              a5
              (Fun e a6 (Fun e a7 (Ret e a1, Ret e a2, Ret e a3, Ret e a4)))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.state34 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)
state41 :: (b1 -> a1 -> a2 -> a3 -> a4 -> b1)
-> b1
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
state41 ns :: b1 -> a1 -> a2 -> a3 -> a4 -> b1
ns i :: b1
i = Fun
  SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
-> Signal b1
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 a5 b.
(MoC e,
 Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
 ~ Fun
     e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e b)))))) =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e b)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e b)
MoC.state41 Fun
  SY b1 (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
b1 -> a1 -> a2 -> a3 -> a4 -> b1
ns (b1 -> Signal b1
forall a. a -> Signal a
unit  b1
i)
state42 :: (b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> (b1, b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
state42 ns :: b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
ns i :: (b1, b2)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2))))))
-> (Signal b1, Signal b2)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun e a3 (Fun e a4 (Fun e a5 (Fun e a6 (Ret e a1, Ret e a2))))))
-> (Stream (e a1), Stream (e a2))
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> (Stream (e a1), Stream (e a2))
MoC.state42 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2))))))
b1 -> b2 -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
ns ((b1, b2) -> (Signal b1, Signal b2)
forall a1 a2. (a1, a2) -> (Signal a1, Signal a2)
unit2 (b1, b2)
i)
state43 :: (b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> (b1, b2, b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
state43 ns :: b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
ns i :: (b1, b2, b3)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           a1
           (Fun
              SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))))
-> (Signal b1, Signal b2, Signal b3)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun e a5 (Fun e a6 (Fun e a7 (Ret e a1, Ret e a2, Ret e a3)))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3))
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> (Stream (e a1), Stream (e a2), Stream (e a3))
MoC.state43 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           a1
           (Fun
              SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))))
b1 -> b2 -> b3 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
ns ((b1, b2, b3) -> (Signal b1, Signal b2, Signal b3)
forall a1 a2 a3. (a1, a2, a3) -> (Signal a1, Signal a2, Signal a3)
unit3 (b1, b2, b3)
i)
state44 :: (b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> (b1, b2, b3, b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
state44 ns :: b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
ns i :: (b1, b2, b3, b4)
i = Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY
                 a2
                 (Fun
                    SY
                    a3
                    (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))))
-> (Signal b1, Signal b2, Signal b3, Signal b4)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 a6 a7 a8.
MoC e =>
Fun
  e
  a1
  (Fun
     e
     a2
     (Fun
        e
        a3
        (Fun
           e
           a4
           (Fun
              e
              a5
              (Fun
                 e
                 a6
                 (Fun e a7 (Fun e a8 (Ret e a1, Ret e a2, Ret e a3, Ret e a4))))))))
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
-> Stream (e a5)
-> Stream (e a6)
-> Stream (e a7)
-> Stream (e a8)
-> (Stream (e a1), Stream (e a2), Stream (e a3), Stream (e a4))
MoC.state44 Fun
  SY
  b1
  (Fun
     SY
     b2
     (Fun
        SY
        b3
        (Fun
           SY
           b4
           (Fun
              SY
              a1
              (Fun
                 SY
                 a2
                 (Fun
                    SY
                    a3
                    (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))))))
b1 -> b2 -> b3 -> b4 -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
ns ((b1, b2, b3, b4) -> (Signal b1, Signal b2, Signal b3, Signal b4)
forall a1 a2 a3 a4.
(a1, a2, a3, a4) -> (Signal a1, Signal a2, Signal a3, Signal a4)
unit4 (b1, b2, b3, b4)
i)


------- MOORE -------

-- | @moore@ processes model Moore state machines. It implements the @moore@ patterns
-- (see 'ForSyDe.Atom.MoC.moore22').
--
-- Constructors: @moore[1-4][1-4]@.
--
-- >>> let s1 = signal [1,2,3,4,5]  
-- >>> moore11 (+) (+1) 1 s1
-- {2,3,5,8,12,17}
--
-- <<fig/moc-sy-pattern-moore.png>>
moore22 :: (st -> a1 -> a2 -> st)
           -- ^ next state function
           -> (st -> (b1, b2))
           -- ^ output decoder
           -> st
           -- ^ initial state
           -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
moore11 :: (st -> a1 -> st) -> (st -> b1) -> st
        -> Signal a1 -> Signal b1
moore12 :: (st -> a1 -> st) -> (st -> (b1, b2)) -> st
        -> Signal a1 -> (Signal b1, Signal b2)
moore13 :: (st -> a1 -> st) -> (st -> (b1, b2, b3)) -> st
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
moore14 :: (st -> a1 -> st) -> (st -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
moore21 :: (st -> a1 -> a2 -> st) -> (st -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal b1
moore23 :: (st -> a1 -> a2 -> st) -> (st -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
moore24 :: (st -> a1 -> a2 -> st) -> (st -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
moore31 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
moore32 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> (b1, b2)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
moore33 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
moore34 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
moore41 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
moore42 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> (b1, b2)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
moore43 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
moore44 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

moore11 :: (st -> a1 -> st) -> (st -> b1) -> st -> Signal a1 -> Signal b1
moore11 ns :: st -> a1 -> st
ns od :: st -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Ret SY b1)
-> Stream (SY st)
-> Signal a1
-> Signal b1
forall (e :: * -> *) a1 a2 b.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Ret e b)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e b)
MoC.moore11 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Ret SY b1)
st -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore12 :: (st -> a1 -> st)
-> (st -> (b1, b2)) -> st -> Signal a1 -> (Signal b1, Signal b2)
moore12 ns :: st -> a1 -> st
ns od :: st -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Ret SY b1, Ret SY b2)
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Ret e b1, Ret e b2)
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2))
MoC.moore12 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Ret SY b1, Ret SY b2)
st -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore13 :: (st -> a1 -> st)
-> (st -> (b1, b2, b3))
-> st
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
moore13 ns :: st -> a1 -> st
ns od :: st -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3)
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.moore13 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
st -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore14 :: (st -> a1 -> st)
-> (st -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
moore14 ns :: st -> a1 -> st
ns od :: st -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.moore14 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
st -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore21 :: (st -> a1 -> a2 -> st)
-> (st -> b1) -> st -> Signal a1 -> Signal a2 -> Signal b1
moore21 ns :: st -> a1 -> a2 -> st
ns od :: st -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Ret SY b1)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal b1
forall (e :: * -> *) a1 a2 a3 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun e a1 (Ret e b)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e b)
MoC.moore21 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Ret SY b1)
st -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore22 :: (st -> a1 -> a2 -> st)
-> (st -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
moore22 ns :: st -> a1 -> a2 -> st
ns od :: st -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Ret SY b1, Ret SY b2)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
forall (e :: * -> *) st a1 a2 b1 b2.
MoC e =>
Fun e st (Fun e a1 (Fun e a2 (Ret e st)))
-> Fun e st (Ret e b1, Ret e b2)
-> Stream (e st)
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2))
MoC.moore22 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Ret SY b1, Ret SY b2)
st -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore23 :: (st -> a1 -> a2 -> st)
-> (st -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
moore23 ns :: st -> a1 -> a2 -> st
ns od :: st -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.moore23 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
st -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore24 :: (st -> a1 -> a2 -> st)
-> (st -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
moore24 ns :: st -> a1 -> a2 -> st
ns od :: st -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.moore24 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
st -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore31 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> b1)
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal b1
moore31 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun SY st (Ret SY b1)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Ret e b)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e b)
MoC.moore31 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun SY st (Ret SY b1)
st -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore32 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
moore32 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun SY st (Ret SY b1, Ret SY b2)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Ret e b1, Ret e b2)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2))
MoC.moore32 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun SY st (Ret SY b1, Ret SY b2)
st -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore33 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
moore33 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.moore33 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
st -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore34 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
moore34 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.moore34 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
st -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore41 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> b1)
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
moore41 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> b1
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun SY st (Ret SY b1)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 a5 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun e a1 (Ret e b)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e b)
MoC.moore41 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun SY st (Ret SY b1)
st -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore42 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
moore42 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> (b1, b2)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun SY st (Ret SY b1, Ret SY b2)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun e a1 (Ret e b1, Ret e b2)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2))
MoC.moore42 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun SY st (Ret SY b1, Ret SY b2)
st -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore43 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
moore43 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> (b1, b2, b3)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.moore43 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3)
st -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
moore44 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
moore44 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> (b1, b2, b3, b4)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun e a1 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.moore44 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun SY st (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)
st -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)


------- MEALY -------

-- | @mealy@ processes model Mealy state machines. It implements the @mealy@ pattern
-- (see 'ForSyDe.Atom.MoC.mealy22').
--
-- Constructors: @mealy[1-4][1-4]@.
--
-- >>> let s1 = signal [1,2,3,4,5]  
-- >>> mealy11 (+) (-) 1 s1
-- {0,0,1,3,6}
--
-- <<fig/moc-sy-pattern-mealy.png>>
mealy22 :: (st -> a1 -> a2 -> st)
           -- ^ next state function
           -> (st -> a1 -> a2 -> (b1, b2))
           -- ^ outpt decoder
           -> st
           -- ^ initial state
           -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2)
mealy11 :: (st -> a1 -> st) -> (st -> a1 -> b1) -> st
        -> Signal a1 -> Signal b1
mealy12 :: (st -> a1 -> st) -> (st -> a1 -> (b1, b2)) -> st
        -> Signal a1 -> (Signal b1, Signal b2)
mealy13 :: (st -> a1 -> st) -> (st -> a1 -> (b1, b2, b3)) -> st
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3)
mealy14 :: (st -> a1 -> st) -> (st -> a1 -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy21 :: (st -> a1 -> a2 -> st) -> (st -> a1 -> a2 -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal b1
mealy23 :: (st -> a1 -> a2 -> st) -> (st -> a1 -> a2 -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3)
mealy24 :: (st -> a1 -> a2 -> st) -> (st -> a1 -> a2 -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy31 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> a1 -> a2 -> a3 -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal b1
mealy32 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> a1 -> a2 -> a3 -> (b1, b2)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2)
mealy33 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> a1 -> a2 -> a3 -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3)
mealy34 :: (st -> a1 -> a2 -> a3 -> st) -> (st -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy41 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> a1 -> a2 -> a3 -> a4 -> b1) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> Signal b1
mealy42 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2)
mealy43 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3)
mealy44 :: (st -> a1 -> a2 -> a3 -> a4 -> st) -> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)) -> st
        -> Signal a1 -> Signal a2 -> Signal a3 -> Signal a4 -> (Signal b1, Signal b2, Signal b3, Signal b4)

mealy11 :: (st -> a1 -> st)
-> (st -> a1 -> b1) -> st -> Signal a1 -> Signal b1
mealy11 ns :: st -> a1 -> st
ns od :: st -> a1 -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Fun SY a1 (Ret SY b1))
-> Stream (SY st)
-> Signal a1
-> Signal b1
forall (e :: * -> *) a1 a2 b.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Fun e a2 (Ret e b))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e b)
MoC.mealy11 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Fun SY a1 (Ret SY b1))
st -> a1 -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy12 :: (st -> a1 -> st)
-> (st -> a1 -> (b1, b2))
-> st
-> Signal a1
-> (Signal b1, Signal b2)
mealy12 ns :: st -> a1 -> st
ns od :: st -> a1 -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Fun SY a1 (Ret SY b1, Ret SY b2))
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Fun e a2 (Ret e b1, Ret e b2))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2))
MoC.mealy12 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Fun SY a1 (Ret SY b1, Ret SY b2))
st -> a1 -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy13 :: (st -> a1 -> st)
-> (st -> a1 -> (b1, b2, b3))
-> st
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
mealy13 ns :: st -> a1 -> st
ns od :: st -> a1 -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun SY st (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.mealy13 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3))
st -> a1 -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy14 :: (st -> a1 -> st)
-> (st -> a1 -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy14 ns :: st -> a1 -> st
ns od :: st -> a1 -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Ret SY st))
-> Fun
     SY st (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))
-> Stream (SY st)
-> Signal a1
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Ret e a1))
-> Fun e a1 (Fun e a2 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.mealy14 Fun SY st (Fun SY a1 (Ret SY st))
st -> a1 -> st
ns Fun SY st (Fun SY a1 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))
st -> a1 -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy21 :: (st -> a1 -> a2 -> st)
-> (st -> a1 -> a2 -> b1)
-> st
-> Signal a1
-> Signal a2
-> Signal b1
mealy21 ns :: st -> a1 -> a2 -> st
ns od :: st -> a1 -> a2 -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY b1)))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal b1
forall (e :: * -> *) a1 a2 a3 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun e a1 (Fun e a2 (Fun e a3 (Ret e b)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e b)
MoC.mealy21 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY b1)))
st -> a1 -> a2 -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy22 :: (st -> a1 -> a2 -> st)
-> (st -> a1 -> a2 -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
mealy22 ns :: st -> a1 -> a2 -> st
ns od :: st -> a1 -> a2 -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2)))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2)
forall (e :: * -> *) st a1 a2 b1 b2.
MoC e =>
Fun e st (Fun e a1 (Fun e a2 (Ret e st)))
-> Fun e st (Fun e a1 (Fun e a2 (Ret e b1, Ret e b2)))
-> Stream (e st)
-> Stream (e a1)
-> Stream (e a2)
-> (Stream (e b1), Stream (e b2))
MoC.mealy22 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2)))
st -> a1 -> a2 -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy23 :: (st -> a1 -> a2 -> st)
-> (st -> a1 -> a2 -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
mealy23 ns :: st -> a1 -> a2 -> st
ns od :: st -> a1 -> a2 -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun
     SY st (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.mealy23 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3)))
st -> a1 -> a2 -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy24 :: (st -> a1 -> a2 -> st)
-> (st -> a1 -> a2 -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy24 ns :: st -> a1 -> a2 -> st
ns od :: st -> a1 -> a2 -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
-> Fun
     SY
     st
     (Fun
        SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Ret e a1)))
-> Fun
     e a1 (Fun e a2 (Fun e a3 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.mealy24 Fun SY st (Fun SY a1 (Fun SY a2 (Ret SY st)))
st -> a1 -> a2 -> st
ns Fun
  SY
  st
  (Fun
     SY a1 (Fun SY a2 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))
st -> a1 -> a2 -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy31 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> a1 -> a2 -> a3 -> b1)
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal b1
mealy31 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> a1 -> a2 -> a3 -> b1
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e b)
MoC.mealy31 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1))))
st -> a1 -> a2 -> a3 -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy32 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> a1 -> a2 -> a3 -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
mealy32 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> a1 -> a2 -> a3 -> (b1, b2)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun
     SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2))
MoC.mealy32 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2))))
st -> a1 -> a2 -> a3 -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy33 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> a1 -> a2 -> a3 -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
mealy33 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> a1 -> a2 -> a3 -> (b1, b2, b3)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun
     SY
     st
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun
     e
     a1
     (Fun e a2 (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.mealy33 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun
  SY
  st
  (Fun
     SY a1 (Fun SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3))))
st -> a1 -> a2 -> a3 -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy34 :: (st -> a1 -> a2 -> a3 -> st)
-> (st -> a1 -> a2 -> a3 -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy34 ns :: st -> a1 -> a2 -> a3 -> st
ns od :: st -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
od i :: st
i = Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
-> Fun
     SY
     st
     (Fun
        SY
        a1
        (Fun
           SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Ret e a1))))
-> Fun
     e
     a1
     (Fun
        e
        a2
        (Fun e a3 (Fun e a4 (Ret e b1, Ret e b2, Ret e b3, Ret e b4))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.mealy34 Fun SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Ret SY st))))
st -> a1 -> a2 -> a3 -> st
ns Fun
  SY
  st
  (Fun
     SY
     a1
     (Fun
        SY a2 (Fun SY a3 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4))))
st -> a1 -> a2 -> a3 -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy41 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> a1 -> a2 -> a3 -> a4 -> b1)
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
mealy41 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> a1 -> a2 -> a3 -> a4 -> b1
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun
     SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> Signal b1
forall (e :: * -> *) a1 a2 a3 a4 a5 b.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e b)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> Stream (e b)
MoC.mealy41 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1)))))
st -> a1 -> a2 -> a3 -> a4 -> b1
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy42 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
mealy42 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun
     SY
     st
     (Fun
        SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2)))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun
     e
     a1
     (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e b1, Ret e b2)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2))
MoC.mealy42 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun
  SY
  st
  (Fun
     SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2)))))
st -> a1 -> a2 -> a3 -> a4 -> (b1, b2)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy43 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
mealy43 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun
     SY
     st
     (Fun
        SY
        a1
        (Fun
           SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2 b3.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun
     e
     a1
     (Fun
        e
        a2
        (Fun e a3 (Fun e a4 (Fun e a5 (Ret e b1, Ret e b2, Ret e b3)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2), Stream (e b3))
MoC.mealy43 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun
  SY
  st
  (Fun
     SY
     a1
     (Fun
        SY a2 (Fun SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3)))))
st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)
mealy44 :: (st -> a1 -> a2 -> a3 -> a4 -> st)
-> (st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4))
-> st
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
mealy44 ns :: st -> a1 -> a2 -> a3 -> a4 -> st
ns od :: st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
od i :: st
i = Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
-> Fun
     SY
     st
     (Fun
        SY
        a1
        (Fun
           SY
           a2
           (Fun
              SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
-> Stream (SY st)
-> Signal a1
-> Signal a2
-> Signal a3
-> Signal a4
-> (Signal b1, Signal b2, Signal b3, Signal b4)
forall (e :: * -> *) a1 a2 a3 a4 a5 b1 b2 b3 b4.
MoC e =>
Fun e a1 (Fun e a2 (Fun e a3 (Fun e a4 (Fun e a5 (Ret e a1)))))
-> Fun
     e
     a1
     (Fun
        e
        a2
        (Fun
           e
           a3
           (Fun e a4 (Fun e a5 (Ret e b1, Ret e b2, Ret e b3, Ret e b4)))))
-> Stream (e a1)
-> Stream (e a2)
-> Stream (e a3)
-> Stream (e a4)
-> Stream (e a5)
-> (Stream (e b1), Stream (e b2), Stream (e b3), Stream (e b4))
MoC.mealy44 Fun
  SY st (Fun SY a1 (Fun SY a2 (Fun SY a3 (Fun SY a4 (Ret SY st)))))
st -> a1 -> a2 -> a3 -> a4 -> st
ns Fun
  SY
  st
  (Fun
     SY
     a1
     (Fun
        SY
        a2
        (Fun
           SY a3 (Fun SY a4 (Ret SY b1, Ret SY b2, Ret SY b3, Ret SY b4)))))
st -> a1 -> a2 -> a3 -> a4 -> (b1, b2, b3, b4)
od (st -> Stream (SY st)
forall a. a -> Signal a
unit st
i)

     
--------------- END DOCUMENTATION ---------------