7-4,      !"#$%&'()*+Safe&Represents a Quadrant in the 2D plane. North West North East South West South East!A list of all quadrants. Same as  [NW .. SE].NoneO An integral coordinate. yA rectangular area of the 2D plane. We keep the type abstract to ensure that invalid extents cannot be constructed. RConstruct an extent. The north value must be > south, and east > west, else ,. &Take the NSEW components of an extent.  A square extent of a given size.&Get the width and height of an extent.<Check if an extent is a square with a width and height of 1.1Check whether a coordinate lies inside an extent.,Check whether a point lies inside an extent.8Get the coordinate that lies at the center of an extent."Cut one quadrant out of an extent.6Get the quadrant that this coordinate lies in, if any.8Constuct a path to a particular coordinate in an extent.If a line segment (P1-P2) intersects the outer edge of an extent then return the intersection point, that is closest to P1, if any. If P1 is inside the extent then -.  P2 / ----/- | / | + | /------ / P1 hCheck whether a line segment's endpoints are inside an extent, or if it intersects with the boundary.  y max (north) y min (south) x max (east) x min (west)   .NoneQV)*The quad tree structure.An empty node.A leaf containint some value.A node with four children.A  tree. A node with . for all its branches. LGet a quadrant from a node. If the tree does not have an outer node then -.!sApply a function to a quadrant of a node. If the tree does not have an outer node then return the original tree."dInsert a value into the tree at the position given by a path. If the path intersects an existing  then return the original tree.#{Insert a value into the node containing this coordinate. The node is created at maximum depth, corresponding to an unit  .$$Lookup a node based on a path to it.%+Lookup an element based given a path to it.&=Lookup a node if a tree given a coordinate which it contains.'IFlatten a QuadTree into a list of its contained values, with coordinates.(EFlatten a QuadTree into a list of its contained values, with extents.&"Extent that covers the whole tree.$Coordinate of the value of interest.'"Extent that covers the whole tree.("Extent that covers the whole tree. !"#$%&'( !"#$%&'(NoneOQV4}*The quadtree contains cells of unit extent (NetHack style). Given a line segement (P1-P2) through the tree, get the cell closest to P1 that intersects the segment, if any.+The quadtree contains cells of unit extent (NetHack style). Given a line segment (P1-P2) through the tree, return the list of cells that intersect the segment.*(P1) Starting point of seg.(P2) Final point of seg. Extent convering the whole tree. The tree.;Intersection point, extent of cell, value of cell (if any).+(P1) Starting point of seg.(P2) Final point of seg.Extent covering the whole tree. The tree.2Intersection point, extent of cell, value of cell.*+*+/      !"#$%&'()*+,-./012314560gloss-algorithms-1.12.0.0-BXqUqUptuFlA0cMBGBAKcNGraphics.Gloss.Data.QuadGraphics.Gloss.Data.ExtentGraphics.Gloss.Data.QuadTree!Graphics.Gloss.Algorithms.RayCastQuadNWNESWSEallQuads $fShowQuad$fEqQuad $fEnumQuadCoordExtent makeExtent takeExtent squareExtent sizeOfExtent isUnitExtent coordInExtent pointInExtentcenterCoordOfExtentcutQuadOfExtent quadOfCoord pathToCoordintersectSegExtenttouchesSegExtent $fEqExtent $fShowExtentQuadTreeTNilTLeafTNode emptyTree emptyNodetakeQuadOfTree liftToQuad insertByPath insertByCoordlookupNodeByPath lookupByPath lookupByCoordflattenQuadTreeflattenQuadTreeWithExtents$fShowQuadTreecastSegIntoCellularQuadTreetraceSegIntoCellularQuadTreebaseGHC.ErrerrorGHC.BaseNothing