You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
accumX :: DSignal dom d Bool -> DSignal dom d Int -> DSignal dom d Int
accumX restart x = feedback $ \q ->
let d = x + mux restart 0 q
z = delayN d1 0 d
in (q, z)
and
accumY :: DSignal dom d Bool -> DSignal dom d Int -> DSignal dom d Int
accumY restart x = feedback $ \q ->
let d = x + mux restart 0 q
z = delayN d1 0 d
in (d, z)
have the same delay signature (no delay), while accumX one outputs x + 0 when restart is True after one cycle; while accumY outputs it immediately.
With antiDelay we can see this distinction in the type signature:
accumD1 :: DSignal dom d Bool -> DSignal dom d Int -> DSignal dom (d + 1) Int
accumD1 restart x =
let d = x + mux restart 0 (antiDelay d1 q)
q = delayN d1 0 d
in q
and
accumD0 :: DSignal dom d Bool -> DSignal dom d Int -> DSignal dom d Int
accumD0 restart x =
let d = x + mux restart 0 (antiDelay d1 q)
q = delayN d1 0 d
in d
We should deprecate feedback and move antiDelay from the "experimental" bracket, as it is clearly the better function for making feedback loops in a context where we want to keep track of delay at the type level.
The text was updated successfully, but these errors were encountered:
and
have the same delay signature (no delay), while
accumX
one outputsx + 0
whenrestart
isTrue
after one cycle; whileaccumY
outputs it immediately.With
antiDelay
we can see this distinction in the type signature:and
We should deprecate
feedback
and moveantiDelay
from the "experimental" bracket, as it is clearly the better function for making feedback loops in a context where we want to keep track of delay at the type level.The text was updated successfully, but these errors were encountered: