Refactor in lens direction

This commit is contained in:
2025-01-04 19:14:18 +00:00
parent 31a74b9ac0
commit 39e3e4ae00
9 changed files with 549485 additions and 824485 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE BangPatterns #-}
module Dodge.Zoning.Base
( zoneExtract
, zoneOfPoint
@@ -79,7 +80,7 @@ yIntercepts' s sp ep = map f $ xIntercepts s (f sp) (f ep)
zoneMonoid :: Semigroup m => Int2 -> m -> IM.IntMap (IM.IntMap m) -> IM.IntMap (IM.IntMap m)
{-# INLINE zoneMonoid #-}
zoneMonoid (V2 x y) a = IM.insertWith f x $! IM.singleton y a
zoneMonoid !(V2 !x !y) a = IM.insertWith f x $! IM.singleton y a
where
f _ = IM.insertWith (<>) y a