diff --git a/package.cabal b/package.cabal index eb2c6a0..2564316 100644 --- a/package.cabal +++ b/package.cabal @@ -9,9 +9,18 @@ Category: Computational Geometry Synopsis: A library of geometric algorithms for Haskell Copyright: (c) 1997, 1998, 2008 by Joern Dinkla, www.dinkla.net Maintainer: joern@dinkla.net +Build-Type: Simple + +Flag buildExamples + description: Build example executables + default: False Library - Build-Depends: base > 4, array, containers + Build-Depends: + prelude-compat >=0.0.0.1 && <0.1, + array, + containers, + base > 4 GHC-Options: -package ghc hs-source-dirs: src Exposed-modules: @@ -28,24 +37,32 @@ Library Tests.Test, Tests.Polys, Applications.AllNearest, Applications.ClosestPair, Applications.DelaunayHull, Applications.MaxEmptyCircle, Applications.NearestPoint, Applications.OnionLayers + Other-modules: + Basics.FiniteMap Executable convexHulls Main-Is: Tests/ConvexHulls.hs hs-source-dirs: src Other-Modules: GrahamsScan, JarvisMarch, MergeHull, KirkpatrickSeidelHull, ChansConvexHull GHC-Options: -package ghc + If !flag(buildExamples) + Buildable: False Executable nearest Main-Is: Tests/Nearest.hs hs-source-dirs: src Other-Modules: Applications.NearestPoint DelaunayDAG GHC-Options: -package ghc + If !flag(buildExamples) + Buildable: False Executable rangeQueries Main-Is: Tests/RangeQueries.hs hs-source-dirs: src Other-Modules: KDTree RangeTree GHC-Options: -package ghc + If !flag(buildExamples) + Buildable: False Executable triangulations Main-Is: Tests/Triangulations.hs @@ -53,16 +70,23 @@ Executable triangulations Other-Modules: ConvexTriangulation, NaiveTriangulation, MonotoneTriangulation, GareysTriangulation, KETTriangulation, AdaptTriangulation, MergeTriangulation GHC-Options: -package ghc + If !flag(buildExamples) + Buildable: False Executable voronoiDelaunay Main-Is: Tests/VoronoiDelaunay.lhs hs-source-dirs: src Other-Modules: Delaunay Voronoi GHC-Options: -package ghc + If !flag(buildExamples) + Buildable: False Executable glConvexHulls Main-Is: OpenGL/GL_ConvexHulls.lhs hs-source-dirs: src Other-Modules: GrahamsScan, JarvisMarch, MergeHull, KirkpatrickSeidelHull, ChansConvexHull - Build-Depends: base, array, GLUT GHC-Options: -package ghc + If flag(buildExamples) + Build-Depends: base, array, GLUT + Else + Buildable: False diff --git a/src/Basics/Pretty.lhs b/src/Basics/Pretty.lhs index 224b16b..16f3670 100644 --- a/src/Basics/Pretty.lhs +++ b/src/Basics/Pretty.lhs @@ -177,6 +177,9 @@ module Basics.Pretty ( render, fullRender ) where +import Prelude2010 +import Prelude () + -- Don't import Util( assertPanic ) because it makes a loop in the module structure infixl 6 <> diff --git a/src/Basics/Topped.lhs b/src/Basics/Topped.lhs index 7ad6da7..c566101 100644 --- a/src/Basics/Topped.lhs +++ b/src/Basics/Topped.lhs @@ -13,6 +13,8 @@ a topped domain > module Basics.Topped where > +> import Control.Applicative (Applicative, pure, (<*>)) +> > import Prelude hiding (RealFloat (isInfinite)) > > data Topped a = Finite a | Infty @@ -26,6 +28,11 @@ a topped domain > fmap f (Finite a) = Finite (f a) > fmap f Infty = Infty > +> instance Applicative Topped where +> Finite f <*> Finite x = Finite $ f x +> _ <*> _ = Infty +> pure = Finite +> > instance Monad Topped where > Infty >>= k = Infty > Finite x >>= k = k x diff --git a/src/Line.lhs b/src/Line.lhs index d6c12e1..60ba22a 100644 --- a/src/Line.lhs +++ b/src/Line.lhs @@ -17,6 +17,9 @@ import Point ( Point ((<+>),(<*>)), Point3, xcoord, ycoord, zcoord, import Point2 ( Point2 (..), P2, Orientation (..), orientation, angle2 ) import Data.Maybe ( isJust, fromJust ) import qualified Point2 (translate, rotateOrg, reflect, rotate) + +import Prelude2010 +import Prelude () \end{code} \begin{code} diff --git a/src/Polygon.lhs b/src/Polygon.lhs index 8865de3..f67fe38 100644 --- a/src/Polygon.lhs +++ b/src/Polygon.lhs @@ -27,6 +27,9 @@ import Line ( Line (..), fromPDL, distanceFromLine, intersect, doIntersect import Basics.Utilities ( rotateL, rotateR, rotateTo, snd3, uncurry3, rotateToBy ) import qualified Triangle import Data.Array ( Array, listArray, (!) ) + +import Prelude2010 +import Prelude () \end{code} \begin{code} diff --git a/src/Tests/Test.hs b/src/Tests/Test.hs index e5a137b..b354fd7 100644 --- a/src/Tests/Test.hs +++ b/src/Tests/Test.hs @@ -14,6 +14,9 @@ import Data.List ( zip4 ) import Basics.Random ( randomInts, randomDoubles ) import Basics.Utilities ( splitsAt ) +import Prelude2010 +import Prelude () + -- -- PSEUDO-ZUFLLIGE MENGEN VON PUNKTEN --