POLYINT: improve haddock doc

This commit is contained in:
hasufell 2014-10-26 14:58:43 +01:00
parent d56d22036c
commit d81b6b1cec
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -50,7 +50,9 @@ sortLexPoly ps = maybe [] (`shiftM` ps) (elemIndex (yMax ps) ps)
-- |Make a PolyPT list out of a regular list of points, so -- |Make a PolyPT list out of a regular list of points, so
-- the predecessor and successors are all saved. -- the predecessor and successors are all saved.
mkPolyPTList :: (PT -> PT -> PT -> PolyPT) -> [PT] -> [PolyPT] mkPolyPTList :: (PT -> PT -> PT -> PolyPT) -- ^ PolyA or PolyB function
-> [PT] -- ^ polygon points
-> [PolyPT]
mkPolyPTList f' pts@(x':y':_:_) = mkPolyPTList f' pts@(x':y':_:_) =
f' x' (last pts) y' : go f' pts f' x' (last pts) y' : go f' pts
where where
@ -71,9 +73,9 @@ sortLexPolys (pA'@(_:_), pB'@(_:_)) =
-- Traverse predecessor and successor and insert them in the right -- Traverse predecessor and successor and insert them in the right
-- order into the resulting queue. -- order into the resulting queue.
-- We start at the max y-coordinates of both polygons. -- We start at the max y-coordinates of both polygons.
go :: BankersDequeue PolyPT go :: BankersDequeue PolyPT -- polyA
-> BankersDequeue PolyPT -> BankersDequeue PolyPT -- polyB
-> BankersDequeue PolyPT -> BankersDequeue PolyPT -- sorted queue
go pA pB go pA pB
-- Nothing to sort. -- Nothing to sort.
| Q.null pA && Q.null pB = Q.empty | Q.null pA && Q.null pB = Q.empty