Fix memory memory leak
- Tuple to strict pair - Self-recursive loops with more knot tying <- this was the thing
This commit is contained in:
+2
-2
@@ -16,7 +16,7 @@ import Data.Aeson (Value, object, (.=))
|
||||
import qualified Data.Text as T
|
||||
import Data.Time (UTCTime (..), utc)
|
||||
import Data.UUID (nil)
|
||||
import AFRP (Mealy (..), Request (..))
|
||||
import AFRP (Mealy (..), Pair (..), Request (..))
|
||||
import HomeAssistant.Controller (HASSEff (..), Service)
|
||||
|
||||
fakeRequest :: Request
|
||||
@@ -52,7 +52,7 @@ runHASS :: Mealy HASSEff a b -> [a] -> [(b, [Service])]
|
||||
runHASS _ [] = []
|
||||
runHASS m (a : as) =
|
||||
case runAcc (runMealy m interp fakeRequest a) [] of
|
||||
((b, m'), svcs) -> (b, svcs) : runHASS m' as
|
||||
(Pair b m', svcs) -> (b, svcs) : runHASS m' as
|
||||
|
||||
services :: [(b, [Service])] -> [[Service]]
|
||||
services = map snd
|
||||
|
||||
Reference in New Issue
Block a user