{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
module FRP.Rhine.SF where
import FRP.Rhine.Clock
import FRP.Rhine.ResamplingBuffer
import FRP.Rhine.Schedule
import FRP.Rhine.SyncSF
data SF m cl a b where
Synchronous
:: ( cl ~ Leftmost cl, cl ~ Rightmost cl)
=> SyncSF m cl a b
-> SF m cl a b
Sequential
:: ( Clock m clab, Clock m clcd
, TimeDomainOf clab ~ TimeDomainOf clcd
, TimeDomainOf clab ~ TimeDomainOf (Rightmost clab)
, TimeDomainOf clcd ~ TimeDomainOf (Leftmost clcd)
)
=> SF m clab a b
-> ResamplingBuffer m (Rightmost clab) (Leftmost clcd) b c
-> SF m clcd c d
-> SF m (SequentialClock m clab clcd) a d
Parallel
:: ( Clock m cl1, Clock m cl2
, TimeDomainOf cl1 ~ TimeDomainOf (Rightmost cl1)
, TimeDomainOf cl2 ~ TimeDomainOf (Rightmost cl2)
, TimeDomainOf cl1 ~ TimeDomainOf cl2
, TimeDomainOf cl1 ~ TimeDomainOf (Leftmost cl1)
, TimeDomainOf cl2 ~ TimeDomainOf (Leftmost cl2)
)
=> SF m cl1 a b
-> SF m cl2 a b
-> SF m (ParallelClock m cl1 cl2) a b