Explicit state

This commit is contained in:
2026-09-12 20:09:42 +03:00
parent e16010bf2f
commit b20320c779
7 changed files with 259 additions and 253 deletions
+3 -1
View File
@@ -18,6 +18,7 @@ import Data.Time (UTCTime (..), utc)
import Data.UUID (nil)
import AFRP (Mealy (..), Pair (..), Request (..))
import HomeAssistant.Controller (HASSEff (..), Service)
import AFRP (stepAuto)
fakeRequest :: Request
fakeRequest = Request (sec 0) utc nil
@@ -51,7 +52,8 @@ interp (Trace _ _) = pure ()
runHASS :: Mealy HASSEff a b -> [a] -> [(b, [Service])]
runHASS _ [] = []
runHASS m (a : as) =
case runAcc (runMealy m interp fakeRequest a) [] of
let w = runMealy m interp
in case runAcc (stepAuto w fakeRequest a) [] of
(Pair b m', svcs) -> (b, svcs) : runHASS m' as
services :: [(b, [Service])] -> [[Service]]