Refactor in lens direction
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user