Remove some Streaming
This commit is contained in:
+18
-15
@@ -1,19 +1,22 @@
|
||||
module Bound where
|
||||
module Bound (
|
||||
boundPoints,
|
||||
) where
|
||||
|
||||
import qualified Control.Foldl as L
|
||||
import Control.Lens
|
||||
import Geometry
|
||||
|
||||
import Control.Lens
|
||||
import Streaming
|
||||
import qualified Streaming.Prelude as S
|
||||
import qualified Control.Foldl as L
|
||||
|
||||
-- NSEW
|
||||
boundPoints :: Stream (Of Point2) Identity () -> Maybe (Float,Float,Float,Float)
|
||||
---- NSEW
|
||||
boundPoints :: [Point2] -> Maybe (Float, Float, Float, Float)
|
||||
{-# INLINE boundPoints #-}
|
||||
boundPoints = f . runIdentity . L.purely S.fold_ ((,,,)
|
||||
<$> L.premap (^?! _2) L.maximum
|
||||
<*> L.premap (^?! _2) L.minimum
|
||||
<*> L.premap (^?! _1) L.maximum
|
||||
<*> L.premap (^?! _1) L.minimum
|
||||
)
|
||||
boundPoints =
|
||||
f
|
||||
. L.fold
|
||||
( (,,,)
|
||||
<$> L.premap (^?! _2) L.maximum
|
||||
<*> L.premap (^?! _2) L.minimum
|
||||
<*> L.premap (^?! _1) L.maximum
|
||||
<*> L.premap (^?! _1) L.minimum
|
||||
)
|
||||
where
|
||||
f (mn,ms,me,mw) = (,,,) <$> mn <*> ms <*> me <*> mw
|
||||
f (mn, ms, me, mw) = (,,,) <$> mn <*> ms <*> me <*> mw
|
||||
|
||||
Reference in New Issue
Block a user