Explicit state
This commit is contained in:
+3
-1
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user