Skip to content

Commit

Permalink
Force new Network after completing a step (#258)
Browse files Browse the repository at this point in the history
Minor, but currently when we step the event network we produce a new `Network`, but nothing forces this. `step` completes and returns a thunk containing the network, which gets stored in an `MVar`. This thunk isn't adding anything, so instead it would be better to just force the `Network`. We could do this either in `step` itself (as done in this commit), or we could force it when we store it the `s` `MVar`.
  • Loading branch information
ocharles authored Jun 15, 2022
1 parent 204940a commit 9f189f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reactive-banana/src/Reactive/Banana/Prim/Low/Evaluation.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-----------------------------------------------------------------------------
reactive-banana
------------------------------------------------------------------------------}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RecordWildCards #-}
module Reactive.Banana.Prim.Low.Evaluation (
step
Expand Down Expand Up @@ -45,7 +46,7 @@ step (inputs,pulses)
actions = OB.inOrder outputs outputs1 -- EvalO actions in proper order

state2 :: Network
state2 = Network
!state2 = Network
{ nTime = next time1
, nOutputs = OB.inserts outputs1 os
, nAlwaysP = alwaysP
Expand Down

0 comments on commit 9f189f1

Please sign in to comment.