Value circuits new#36
Conversation
Since #14 the error locations often pointed to the end of the circuit instead of the correct location. That should now be fixed, along with a regression test.
f847f89 to
b2f0f98
Compare
|
RIP Fable.. I find that I typically mix and match accum :: Circuit (Signal dom Int) (Signal dom Int)
accum = circuit \(Fwd (Values i)) -> do
Fwd (Values acc) <- registerC 0 -< Fwd (Values acc')
let acc' = acc + i
idC -< Fwd (Values acc')~ accum :: Circuit (Signal dom Int) (Signal dom Int)
accum = circuit \(Fwd (Values i)) -> do
let
Values acc = register 0 (Values acc')
acc' = acc + i
idC -< Fwd (Values acc')Not sure about any of this, just floating an idea. |
|
I'll think about it but adding support in general Haskell expressions and bindings might open a whole can of worms. Right now, since it's limited to the "arrow land", it's relatively simple without much in the way of edge cases (I hope). I'm generally in favour of keeping the plugin simple and predictable at the cost of a bit of verbosity. You can always use helpers (something like |
|
Yeah, makes sense. I'd rather have less magic too. |
The value level circuit syntax I originally started work on 6 years ago! master...value-circuits
This was written with the anthropic's new fable model. I also got it to add significantly more testing.
This gets you pretty close to being able to write everything with circuit syntax! Mealy machines can be done with a
registerC:It also supports multiple clock domains (although you don't get a great error when you mix them up):
and
DSignalCsupport (makes sure all groups have the same delay):