Remove old zoning code

This commit is contained in:
2022-08-21 22:10:38 +01:00
parent c35dbf1ba8
commit 496066e727
5 changed files with 8 additions and 191 deletions
-28
View File
@@ -1,28 +0,0 @@
module Dodge.Zone.Update (
--updateZoning,
) where
import Dodge.Data.Zoning
import Geometry
import qualified IntMapHelp as IM
import LensHelp
import qualified Streaming.Prelude as S
updateZoning :: Monoid (t a) => (a -> t a -> t a) -> a -> Zoning t a -> Zoning t a
{-# INLINE updateZoning #-}
updateZoning f obj zn = runIdentity (S.fold_ doinsert zn id (_znFunc zn (_znSize zn) obj))
where
doinsert znobs vxy = insertInZoneWith vxy (\_ -> f obj) (f obj mempty) znobs
insertInZoneWith ::
Int2 ->
-- | Combining function
(t a -> t a -> t a) ->
-- | Value to insert
t a ->
Zoning t a ->
Zoning t a
{-# INLINE insertInZoneWith #-}
insertInZoneWith (V2 x y) fun obj = over znObjects $ IM.insertWith f x $ IM.singleton y obj
where
f _ = IM.insertWith fun y obj