geojson 3.0.3 → 3.0.4
raw patch · 5 files changed
+46/−7 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.SeqHelper: unique :: Eq a => Seq a -> Seq a
+ Data.SeqHelper: removeNextDuplicate :: Eq a => Seq a -> Seq a
- Data.Geospatial: bbox :: forall a_aJKa. Lens' (GeoFeature a_aJKa) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial: bbox :: forall a_aCEj. Lens' (GeoFeature a_aCEj) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial: boundingbox :: forall a_aLjR. Lens' (GeoFeatureCollection a_aLjR) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial: boundingbox :: forall a_aE7k. Lens' (GeoFeatureCollection a_aE7k) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial: class HasGeoPositionWithoutCRS c_ao1b
+ Data.Geospatial: class HasGeoPositionWithoutCRS c_aj1V
- Data.Geospatial: featureId :: forall a_aJKa. Lens' (GeoFeature a_aJKa) (Maybe FeatureID)
+ Data.Geospatial: featureId :: forall a_aCEj. Lens' (GeoFeature a_aCEj) (Maybe FeatureID)
- Data.Geospatial: geoPositionWithoutCRS :: HasGeoPositionWithoutCRS c_ao1b => Lens' c_ao1b GeoPositionWithoutCRS
+ Data.Geospatial: geoPositionWithoutCRS :: HasGeoPositionWithoutCRS c_aj1V => Lens' c_aj1V GeoPositionWithoutCRS
- Data.Geospatial: geofeatures :: forall a_aLjR a_aLmq. Lens (GeoFeatureCollection a_aLjR) (GeoFeatureCollection a_aLmq) (Seq (GeoFeature a_aLjR)) (Seq (GeoFeature a_aLmq))
+ Data.Geospatial: geofeatures :: forall a_aE7k a_aE9T. Lens (GeoFeatureCollection a_aE7k) (GeoFeatureCollection a_aE9T) (Seq (GeoFeature a_aE7k)) (Seq (GeoFeature a_aE9T))
- Data.Geospatial: geometry :: forall a_aJKa. Lens' (GeoFeature a_aJKa) GeospatialGeometry
+ Data.Geospatial: geometry :: forall a_aCEj. Lens' (GeoFeature a_aCEj) GeospatialGeometry
- Data.Geospatial: properties :: forall a_aJKa a_aJRD. Lens (GeoFeature a_aJKa) (GeoFeature a_aJRD) a_aJKa a_aJRD
+ Data.Geospatial: properties :: forall a_aCEj a_aCLM. Lens (GeoFeature a_aCEj) (GeoFeature a_aCLM) a_aCEj a_aCLM
- Data.Geospatial.Internal.BasicTypes: class HasGeoPositionWithoutCRS c_ao1b
+ Data.Geospatial.Internal.BasicTypes: class HasGeoPositionWithoutCRS c_aj1V
- Data.Geospatial.Internal.BasicTypes: geoPositionWithoutCRS :: HasGeoPositionWithoutCRS c_ao1b => Lens' c_ao1b GeoPositionWithoutCRS
+ Data.Geospatial.Internal.BasicTypes: geoPositionWithoutCRS :: HasGeoPositionWithoutCRS c_aj1V => Lens' c_aj1V GeoPositionWithoutCRS
- Data.Geospatial.Internal.GeoFeature: bbox :: forall a_aJKa. Lens' (GeoFeature a_aJKa) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial.Internal.GeoFeature: bbox :: forall a_aCEj. Lens' (GeoFeature a_aCEj) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial.Internal.GeoFeature: featureId :: forall a_aJKa. Lens' (GeoFeature a_aJKa) (Maybe FeatureID)
+ Data.Geospatial.Internal.GeoFeature: featureId :: forall a_aCEj. Lens' (GeoFeature a_aCEj) (Maybe FeatureID)
- Data.Geospatial.Internal.GeoFeature: geometry :: forall a_aJKa. Lens' (GeoFeature a_aJKa) GeospatialGeometry
+ Data.Geospatial.Internal.GeoFeature: geometry :: forall a_aCEj. Lens' (GeoFeature a_aCEj) GeospatialGeometry
- Data.Geospatial.Internal.GeoFeature: properties :: forall a_aJKa a_aJRD. Lens (GeoFeature a_aJKa) (GeoFeature a_aJRD) a_aJKa a_aJRD
+ Data.Geospatial.Internal.GeoFeature: properties :: forall a_aCEj a_aCLM. Lens (GeoFeature a_aCEj) (GeoFeature a_aCLM) a_aCEj a_aCLM
- Data.Geospatial.Internal.GeoFeatureCollection: boundingbox :: forall a_aLjR. Lens' (GeoFeatureCollection a_aLjR) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial.Internal.GeoFeatureCollection: boundingbox :: forall a_aE7k. Lens' (GeoFeatureCollection a_aE7k) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial.Internal.GeoFeatureCollection: geofeatures :: forall a_aLjR a_aLmq. Lens (GeoFeatureCollection a_aLjR) (GeoFeatureCollection a_aLmq) (Seq (GeoFeature a_aLjR)) (Seq (GeoFeature a_aLmq))
+ Data.Geospatial.Internal.GeoFeatureCollection: geofeatures :: forall a_aE7k a_aE9T. Lens (GeoFeatureCollection a_aE7k) (GeoFeatureCollection a_aE9T) (Seq (GeoFeature a_aE7k)) (Seq (GeoFeature a_aE9T))
Files
- geojson.cabal +3/−2
- src/Data/SeqHelper.hs +7/−4
- test/Data/LinearRingTests.hs +8/−1
- test/Data/SeqHelperTests.hs +26/−0
- test/Main.hs +2/−0
geojson.cabal view
@@ -1,5 +1,5 @@ name: geojson-version: 3.0.3+version: 3.0.4 license: BSD3 license-file: LICENCE author: Dom De Re@@ -27,7 +27,7 @@ source-repository this type: git location: https://github.com/indicatrix/hs-geojson.git- tag: 3.0.3+ tag: 3.0.4 library hs-source-dirs: src@@ -79,6 +79,7 @@ , Fixture , Data.LinearRingTests , Data.LineStringTests+ , Data.SeqHelperTests , Data.Geospatial.Internal.CRSTests , Data.Geospatial.Internal.GeoFeatureCollectionTests , Data.Geospatial.Internal.GeoFeatureTests
src/Data/SeqHelper.hs view
@@ -8,7 +8,7 @@ module Data.SeqHelper ( sequenceHead , sequenceTail- , unique+ , removeNextDuplicate ) where import qualified Data.Sequence as Sequence@@ -25,6 +25,9 @@ sequenceTail _ = Sequence.empty {-# INLINE sequenceTail #-} -unique :: Eq a => Sequence.Seq a -> Sequence.Seq a-unique Sequence.Empty = Sequence.empty-unique (x Sequence.:<| xs) = (Sequence.<|) x (unique (Sequence.filter (x /=) xs))+removeNextDuplicate :: Eq a => Sequence.Seq a -> Sequence.Seq a+removeNextDuplicate Sequence.Empty = Sequence.empty+removeNextDuplicate xs@(_ Sequence.:<| Sequence.Empty) = xs+removeNextDuplicate (x Sequence.:<| tailXs@(y Sequence.:<| _))+ | x /= y = x Sequence.<| removeNextDuplicate tailXs+ | otherwise = removeNextDuplicate tailXs
test/Data/LinearRingTests.hs view
@@ -33,7 +33,8 @@ [ testSpec "Data.LinearRing.fromList" testFromList , testSpec "Data.LinearRing.fromSeq" testFromSequence , testSpec "Data.LinearRing.combineToSequence" testCombineToSequence- , testSpec "Data.LinearRing.testToSequence" testToSequence+ , testSpec "Data.LinearRing.toSequence" testToSequence+ , testSpec "Data.LinearRing.foldMap" testFoldMap ] pure $ testGroup "Data.LinearRingTests.Spec" specs @@ -127,6 +128,12 @@ LinearRing.toSeq (LinearRing.makeLinearRing 0 1 0 Sequence.empty) `shouldBe` Sequence.fromList ([0, 1, 0] :: [Int]) LinearRing.toSeq (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [0])) `shouldBe` Sequence.fromList ([0, 1, 2, 0] :: [Int]) LinearRing.toSeq (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4,0])) `shouldBe` Sequence.fromList ([0, 1, 2, 4, 0] :: [Int])++testFoldMap :: Spec+testFoldMap =+ describe "foldMap" $+ it "foldMap of a LinearRing" $+ foldMap (\x -> Sequence.singleton (x + 1)) (LinearRing.makeLinearRing 0 1 2 Sequence.empty) `shouldBe` Sequence.fromList ([1, 2, 3, 1] :: [Int]) -- TODO
+ test/Data/SeqHelperTests.hs view
@@ -0,0 +1,26 @@+module Data.SeqHelperTests where++import qualified Data.List.NonEmpty as ListNonEmpty+import qualified Data.Sequence as Sequence+import qualified Data.Validation as Validation+import Test.Tasty+import Test.Tasty.Hspec (Spec, context, describe,+ it, shouldBe, testSpec)+import Test.Tasty.QuickCheck (Property, property,+ testProperty)+-- Local+import Arbitrary ()+import qualified Data.Geospatial.Internal.BasicTypes as BasicTypes+import qualified Data.SeqHelper as SeqHelper++-- Tests++tests :: IO TestTree+tests =+ testSpec "Data.SeqHelper.removeNextDuplicate" testRemoveNextDuplicate++testRemoveNextDuplicate :: Spec+testRemoveNextDuplicate =+ describe "removeNextDuplicate" $+ it "Make it clear" $+ SeqHelper.removeNextDuplicate (Sequence.fromList ([1, 1, 2, 3, 3, 3, 1] :: [Int])) `shouldBe` Sequence.fromList ([1, 2, 3, 1] :: [Int])
test/Main.hs view
@@ -8,6 +8,7 @@ import qualified Data.Geospatial.Internal.GeometryTests as G import qualified Data.LinearRingTests as LR import qualified Data.LineStringTests as LS+import qualified Data.SeqHelperTests as SH main :: IO ()@@ -15,6 +16,7 @@ tests <- sequence [ LR.tests , LS.tests+ , SH.tests , CRS.tests , FC.tests , F.tests