Copyright | (c) Frank Staals |
---|---|
License | See LICENCE file |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type family Dimension t :: Nat
- type family NumType t :: *
- data NoIntersection = NoIntersection
- type Intersection g h = CoRec Identity (IntersectionOf g h)
- type family IntersectionOf g h :: [*]
- coRec :: a ∈ as => a -> CoRec Identity as
- class IsIntersectableWith g h where
- type AlwaysTrueIntersection g h = RecApplicative (IntersectionOf g h)
- defaultNonEmptyIntersection :: forall g h proxy. (NoIntersection ∈ IntersectionOf g h, RecApplicative (IntersectionOf g h)) => proxy g -> proxy h -> Intersection g h -> Bool
- type family Union g h :: *
- class IsUnionableWith g h where
Documentation
type family Dimension t :: Nat Source #
A type family for types that are associated with a dimension. The dimension is the dimension of the geometry they are embedded in.
Instances
type family NumType t :: * Source #
A type family for types that have an associated numeric type.
Instances
data NoIntersection Source #
A simple data type expressing that there are no intersections
Instances
Eq NoIntersection Source # | |
Defined in Data.Geometry.Properties (==) :: NoIntersection -> NoIntersection -> Bool # (/=) :: NoIntersection -> NoIntersection -> Bool # | |
Ord NoIntersection Source # | |
Defined in Data.Geometry.Properties compare :: NoIntersection -> NoIntersection -> Ordering # (<) :: NoIntersection -> NoIntersection -> Bool # (<=) :: NoIntersection -> NoIntersection -> Bool # (>) :: NoIntersection -> NoIntersection -> Bool # (>=) :: NoIntersection -> NoIntersection -> Bool # max :: NoIntersection -> NoIntersection -> NoIntersection # min :: NoIntersection -> NoIntersection -> NoIntersection # | |
Read NoIntersection Source # | |
Defined in Data.Geometry.Properties readsPrec :: Int -> ReadS NoIntersection # readList :: ReadS [NoIntersection] # | |
Show NoIntersection Source # | |
Defined in Data.Geometry.Properties showsPrec :: Int -> NoIntersection -> ShowS # show :: NoIntersection -> String # showList :: [NoIntersection] -> ShowS # |
type Intersection g h = CoRec Identity (IntersectionOf g h) Source #
The result of interesecting two geometries is a CoRec,
type family IntersectionOf g h :: [*] Source #
The type family specifying the list of possible result types of an intersection.
Instances
class IsIntersectableWith g h where Source #
intersect :: g -> h -> Intersection g h Source #
intersects :: g -> h -> Bool Source #
g intersects
h = The intersection of g and h is non-empty.
The default implementation computes the intersection of g and h, and uses nonEmptyIntersection to determine if the intersection is non-empty.
nonEmptyIntersection :: proxy g -> proxy h -> Intersection g h -> Bool Source #
Helper to implement intersects
.
nonEmptyIntersection :: (NoIntersection ∈ IntersectionOf g h, RecApplicative (IntersectionOf g h)) => proxy g -> proxy h -> Intersection g h -> Bool Source #
Helper to implement intersects
.
Instances
type AlwaysTrueIntersection g h = RecApplicative (IntersectionOf g h) Source #
When using IntersectionOf we may need some constraints that are always true anyway.
defaultNonEmptyIntersection :: forall g h proxy. (NoIntersection ∈ IntersectionOf g h, RecApplicative (IntersectionOf g h)) => proxy g -> proxy h -> Intersection g h -> Bool Source #
Returns True iff the result is *not* a NoIntersection