Move toward diagnosing state update leak

This commit is contained in:
jgk
2021-08-18 11:53:14 +02:00
parent cfb27d4a76
commit a6f08aef16
9 changed files with 81 additions and 91 deletions
+3 -3
View File
@@ -2,14 +2,14 @@ module Dodge.Creature.Update
where
import Dodge.Data
import System.Random
--import System.Random
import Data.Monoid
-- combinators for helping with dealing with creature update
type CRUpdate = World -> (World -> World,StdGen) -> Creature -> ((World -> World,StdGen), Maybe Creature)
unrandUpdate
:: (Creature -> World -> World)
-> (Creature -> Maybe Creature)
-> CRUpdate
{-# INLINE unrandUpdate #-}
unrandUpdate h cF _ (f,g) cr = ( ( h cr . f , g) , cF cr )
unrandUpdate h cF cr _ = ( Endo (h cr) , cF cr )