packages feed

geojson 3.0.0 → 3.0.1

raw patch · 6 files changed

+104/−85 lines, 6 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.LineString: combineToVector :: (a -> a -> b) -> LineString a -> Seq b
- Data.LineString: fromVector :: (Validate v) => Seq a -> v VectorToLineStringError (LineString a)
- Data.LineString: toVector :: LineString a -> Seq a
- Data.LinearRing: combineToVector :: (a -> a -> b) -> LinearRing a -> Seq b
- Data.LinearRing: fromVector :: (Eq a, Show a, Validate v, Functor (v (NonEmpty (ListToLinearRingError a)))) => Seq a -> v (NonEmpty (VectorToLinearRingError a)) (LinearRing a)
- Data.LinearRing: toVector :: LinearRing a -> Seq a
+ Data.LineString: combineToSeq :: (a -> a -> b) -> LineString a -> Seq b
+ Data.LineString: fromSeq :: (Validate v) => Seq a -> v VectorToLineStringError (LineString a)
+ Data.LineString: toSeq :: LineString a -> Seq a
+ Data.LinearRing: combineToSeq :: (a -> a -> b) -> LinearRing a -> Seq b
+ Data.LinearRing: fromSeq :: (Eq a, Show a, Validate v, Functor (v (NonEmpty (ListToLinearRingError a)))) => Seq a -> v (NonEmpty (VectorToLinearRingError a)) (LinearRing a)
+ Data.LinearRing: toSeq :: LinearRing a -> Seq a
+ Data.SeqHelper: sequenceHead :: Seq a -> Seq a
+ Data.SeqHelper: sequenceTail :: Seq a -> Seq a
- Data.Geospatial: bbox :: forall a_aJIa. Lens' (GeoFeature a_aJIa) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial: bbox :: forall a_aJFF. Lens' (GeoFeature a_aJFF) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial: boundingbox :: forall a_aLhR. Lens' (GeoFeatureCollection a_aLhR) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial: boundingbox :: forall a_aLfm. Lens' (GeoFeatureCollection a_aLfm) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial: featureId :: forall a_aJIa. Lens' (GeoFeature a_aJIa) (Maybe FeatureID)
+ Data.Geospatial: featureId :: forall a_aJFF. Lens' (GeoFeature a_aJFF) (Maybe FeatureID)
- Data.Geospatial: geofeatures :: forall a_aLhR a_aLkq. Lens (GeoFeatureCollection a_aLhR) (GeoFeatureCollection a_aLkq) (Seq (GeoFeature a_aLhR)) (Seq (GeoFeature a_aLkq))
+ Data.Geospatial: geofeatures :: forall a_aLfm a_aLhV. Lens (GeoFeatureCollection a_aLfm) (GeoFeatureCollection a_aLhV) (Seq (GeoFeature a_aLfm)) (Seq (GeoFeature a_aLhV))
- Data.Geospatial: geometry :: forall a_aJIa. Lens' (GeoFeature a_aJIa) GeospatialGeometry
+ Data.Geospatial: geometry :: forall a_aJFF. Lens' (GeoFeature a_aJFF) GeospatialGeometry
- Data.Geospatial: properties :: forall a_aJIa a_aJPD. Lens (GeoFeature a_aJIa) (GeoFeature a_aJPD) a_aJIa a_aJPD
+ Data.Geospatial: properties :: forall a_aJFF a_aJN8. Lens (GeoFeature a_aJFF) (GeoFeature a_aJN8) a_aJFF a_aJN8
- Data.Geospatial.Internal.GeoFeature: bbox :: forall a_aJIa. Lens' (GeoFeature a_aJIa) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial.Internal.GeoFeature: bbox :: forall a_aJFF. Lens' (GeoFeature a_aJFF) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial.Internal.GeoFeature: featureId :: forall a_aJIa. Lens' (GeoFeature a_aJIa) (Maybe FeatureID)
+ Data.Geospatial.Internal.GeoFeature: featureId :: forall a_aJFF. Lens' (GeoFeature a_aJFF) (Maybe FeatureID)
- Data.Geospatial.Internal.GeoFeature: geometry :: forall a_aJIa. Lens' (GeoFeature a_aJIa) GeospatialGeometry
+ Data.Geospatial.Internal.GeoFeature: geometry :: forall a_aJFF. Lens' (GeoFeature a_aJFF) GeospatialGeometry
- Data.Geospatial.Internal.GeoFeature: properties :: forall a_aJIa a_aJPD. Lens (GeoFeature a_aJIa) (GeoFeature a_aJPD) a_aJIa a_aJPD
+ Data.Geospatial.Internal.GeoFeature: properties :: forall a_aJFF a_aJN8. Lens (GeoFeature a_aJFF) (GeoFeature a_aJN8) a_aJFF a_aJN8
- Data.Geospatial.Internal.GeoFeatureCollection: boundingbox :: forall a_aLhR. Lens' (GeoFeatureCollection a_aLhR) (Maybe BoundingBoxWithoutCRS)
+ Data.Geospatial.Internal.GeoFeatureCollection: boundingbox :: forall a_aLfm. Lens' (GeoFeatureCollection a_aLfm) (Maybe BoundingBoxWithoutCRS)
- Data.Geospatial.Internal.GeoFeatureCollection: geofeatures :: forall a_aLhR a_aLkq. Lens (GeoFeatureCollection a_aLhR) (GeoFeatureCollection a_aLkq) (Seq (GeoFeature a_aLhR)) (Seq (GeoFeature a_aLkq))
+ Data.Geospatial.Internal.GeoFeatureCollection: geofeatures :: forall a_aLfm a_aLhV. Lens (GeoFeatureCollection a_aLfm) (GeoFeatureCollection a_aLhV) (Seq (GeoFeature a_aLfm)) (Seq (GeoFeature a_aLhV))

Files

geojson.cabal view
@@ -1,5 +1,5 @@-name:                  geojson-version:                3.0.0+name:                   geojson+version:                3.0.1 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.0+    tag:                3.0.1  library     hs-source-dirs:     src@@ -45,6 +45,7 @@     exposed-modules:    Data.Geospatial                     ,   Data.LinearRing                     ,   Data.LineString+                    ,   Data.SeqHelper                     ,   Data.Geospatial.Internal.BasicTypes                     ,   Data.Geospatial.Internal.CRS                     ,   Data.Geospatial.Internal.GeoFeature
src/Data/LineString.hs view
@@ -19,9 +19,9 @@     ,   ListToLineStringError(..)     ,   VectorToLineStringError(..)     -- * Functions-    ,   toVector-    ,   combineToVector-    ,   fromVector+    ,   toSeq+    ,   combineToSeq+    ,   fromSeq     ,   fromLineString     ,   fromList     ,   makeLineString@@ -44,6 +44,8 @@ import qualified Data.Validation     as Validation import           GHC.Generics        (Generic) +import qualified Data.SeqHelper      as SeqHelper+ -- | -- a LineString has at least 2 elements --@@ -108,53 +110,49 @@ {-# INLINE fromList #-}  -- |--- create a vector from a LineString by combining values.+-- create a sequence from a LineString by combining values. -- LineString 1 2 [3,4] (,) --> Vector [(1,2),(2,3),(3,4)] ---combineToVector :: (a -> a -> b) -> LineString a -> Sequence.Seq b-combineToVector combine (LineString a b rest) = combine a b Sequence.<| combineRest+combineToSeq :: (a -> a -> b) -> LineString a -> Sequence.Seq b+combineToSeq combine (LineString a b rest) = combine a b Sequence.<| combineRest     where         combineRest =           if Sequence.null rest             then               Sequence.empty             else-              (Sequence.zipWith combine <*> sequenceTail) (b Sequence.<| rest)-{-# INLINE combineToVector #-}--sequenceTail :: Sequence.Seq a -> Sequence.Seq a-sequenceTail (_ Sequence.:<| tailS) = tailS-sequenceTail _                      = Sequence.empty+              (Sequence.zipWith combine <*> SeqHelper.sequenceTail) (b Sequence.<| rest)+{-# INLINE combineToSeq #-}  -- |--- create a vector from a LineString.+-- create a sequence from a LineString. -- LineString 1 2 [3,4] --> Vector [1,2,3,4] ---toVector :: LineString a -> Sequence.Seq a-toVector (LineString a b rest) = a Sequence.<| ( b  Sequence.<| rest)-{-# INLINE toVector #-}+toSeq :: LineString a -> Sequence.Seq a+toSeq (LineString a b rest) = a Sequence.<| ( b  Sequence.<| rest)+{-# INLINE toSeq #-}  -- |--- creates a LineString out of a vector of elements,+-- creates a LineString out of a sequence of elements, -- if there are enough elements (needs at least 2) elements ---fromVector :: (Validation.Validate v) => Sequence.Seq a -> v VectorToLineStringError (LineString a)-fromVector v@(headS Sequence.:<| tailS) =+fromSeq :: (Validation.Validate v) => Sequence.Seq a -> v VectorToLineStringError (LineString a)+fromSeq v@(headS Sequence.:<| tailS) =   if Sequence.null v then     Validation._Failure # SingletonVector   else-    fromVector' headS tailS-fromVector _ = Validation._Failure # VectorEmpty-{-# INLINE fromVector #-}+    fromSeq' headS tailS+fromSeq _ = Validation._Failure # VectorEmpty+{-# INLINE fromSeq #-} -fromVector' :: (Validation.Validate v) => a -> Sequence.Seq a -> v VectorToLineStringError (LineString a)-fromVector' first v@(headS Sequence.:<| tailS) =+fromSeq' :: (Validation.Validate v) => a -> Sequence.Seq a -> v VectorToLineStringError (LineString a)+fromSeq' first v@(headS Sequence.:<| tailS) =   if Sequence.null v then     Validation._Failure # SingletonVector   else     Validation._Success # LineString first headS tailS-fromVector' _ _ = Validation._Failure # SingletonVector-{-# INLINE fromVector' #-}+fromSeq' _ _ = Validation._Failure # SingletonVector+{-# INLINE fromSeq' #-}  -- | -- Creates a LineString@@ -216,6 +214,6 @@ -- safeLast x = if Sequence.null x then Nothing else Just $ Sequence.last x safeLast :: Sequence.Seq a -> Maybe a safeLast x = case Sequence.viewr x of-                Sequence.EmptyR ->  Nothing+                Sequence.EmptyR -> Nothing                 _ Sequence.:> b -> Just b {-# INLINE safeLast #-}
src/Data/LinearRing.hs view
@@ -21,9 +21,9 @@     ,   ListToLinearRingError(..)     ,   VectorToLinearRingError(..)     -- * Functions-    ,   toVector-    ,   combineToVector-    ,   fromVector+    ,   toSeq+    ,   combineToSeq+    ,   fromSeq     ,   fromLinearRing     ,   fromList     ,   fromListWithEqCheck@@ -52,6 +52,8 @@ import qualified Data.Validation     as Validation import           GHC.Generics        (Generic) +import qualified Data.SeqHelper      as SeqHelper+ -- | -- a LinearRing has at least 3 (distinct) elements --@@ -130,41 +132,36 @@ fromListWithEqCheck xs = checkHeadAndLastEq xs *> fromList xs  -- |--- create a vector from a LinearRing by combining values.+-- create a sequence from a LinearRing by combining values. -- LinearRing 1 2 3 [4,1] (,) --> Vector [(1,2),(2,3),(3,4),(4,1)] ---combineToVector :: (a -> a -> b) -> LinearRing a -> Sequence.Seq b-combineToVector combine (LinearRing a b c rest) = combine a b Sequence.:<| (combine b c Sequence.:<| combineRest)+combineToSeq :: (a -> a -> b) -> LinearRing a -> Sequence.Seq b+combineToSeq combine (LinearRing a b c rest) = combine a b Sequence.:<| (combine b c Sequence.:<| combineRest)     where         combineRest =           if Sequence.null rest             then               Sequence.empty             else-                (Sequence.zipWith combine <*> sequenceTail) (c Sequence.<| rest)-{-# INLINE combineToVector #-}--sequenceTail :: Sequence.Seq a -> Sequence.Seq a-sequenceTail (_ Sequence.:<| tailS) = tailS-sequenceTail _                      = Sequence.empty+                (Sequence.zipWith combine <*> SeqHelper.sequenceTail) (c Sequence.<| rest)+{-# INLINE combineToSeq #-}  -- |--- create a vector from a LinearRing.+-- create a sequence from a LinearRing. -- LinearRing 1 2 3 [4,1] --> Vector [1,2,3,4,1)] ---toVector :: LinearRing a -> Sequence.Seq a-toVector (LinearRing a b c rest) = a Sequence.:<| (b Sequence.:<| (c Sequence.:<| rest))-{-# INLINE toVector #-}+toSeq :: LinearRing a -> Sequence.Seq a+toSeq (LinearRing a b c rest) = a Sequence.:<| (b Sequence.:<| (c Sequence.:<| rest))+{-# INLINE toSeq #-}  -- | -- creates a LinearRing out of a vector of elements, -- if there are enough elements (needs at least 3) elements ----- fromVector (x:y:z:ws@(_:_)) = _Success # LinearRing x y z (fromListDropLast ws)--- fromList xs               = _Failure # return (ListTooShort (length xs))--fromVector :: (Eq a, Show a, Validation.Validate v, Functor (v (NonEmpty (ListToLinearRingError a)))) => Sequence.Seq a -> v (NonEmpty (VectorToLinearRingError a)) (LinearRing a)-fromVector as =+-- fromSeq (x:y:z:ws@(_:_))  = _Success # LinearRing x y z (fromListDropLast ws)+-- fromSeq xs                = _Failure # return (ListTooShort (length xs))+fromSeq :: (Eq a, Show a, Validation.Validate v, Functor (v (NonEmpty (ListToLinearRingError a)))) => Sequence.Seq a -> v (NonEmpty (VectorToLinearRingError a)) (LinearRing a)+fromSeq as =     case as of         (first Sequence.:<| (second Sequence.:<| (third Sequence.:<| rest@(_ Sequence.:|> lastS)))) ->             if first == lastS then@@ -178,7 +175,7 @@                 Validation._Failure # pure (FirstNotEqualToLast first third)         v -> Validation._Failure # pure (VectorTooShort (Sequence.length v))         _ -> Validation._Failure # pure (VectorTooShort 0)-{-# INLINE fromVector #-}+{-# INLINE fromSeq #-}  -- | -- Creates a LinearRing@@ -266,9 +263,5 @@ fromListDropLast :: (Eq a) => [a] -> Sequence.Seq a fromListDropLast []  = Sequence.empty fromListDropLast [_] = Sequence.empty-fromListDropLast x   = sequenceHead $ Sequence.fromList x+fromListDropLast x   = SeqHelper.sequenceHead $ Sequence.fromList x --- All but the last-sequenceHead :: Sequence.Seq a -> Sequence.Seq a-sequenceHead (headS Sequence.:|> _) = headS-sequenceHead _                      = Sequence.empty
+ src/Data/SeqHelper.hs view
@@ -0,0 +1,27 @@+-------------------------------------------------------------------+-- |+-- Module       : Data.Geospatial.Internal.SeqHelpers+-- Copyright    : (C) 2014-2018 HS-GeoJSON Project+-- License      : BSD-style (see the file LICENSE.md)+-- Maintainer   : Andrew Newman+--+-- see Section 2.1.1 /Position/ in the GeoJSON Spec+-------------------------------------------------------------------+module Data.SeqHelper (+  sequenceHead+  , sequenceTail+  ) where++import qualified Data.Sequence as Sequence++-- All but the last+sequenceHead :: Sequence.Seq a -> Sequence.Seq a+sequenceHead (headS Sequence.:|> _) = headS+sequenceHead _                      = Sequence.empty+{-# INLINE sequenceHead #-}++-- All but the first+sequenceTail :: Sequence.Seq a -> Sequence.Seq a+sequenceTail (_ Sequence.:<| tailS) = tailS+sequenceTail _                      = Sequence.empty+{-# INLINE sequenceTail #-}
test/Data/LineStringTests.hs view
@@ -29,8 +29,8 @@ specTests = do   specs <- sequence     [ testSpec "Data.LineString.fromList" testFromList-    , testSpec "Data.LineString.fromVector" testFromVector-    , testSpec "Data.LineString.toVector" testToVector+    , testSpec "Data.LineString.fromSeq" testFromVector+    , testSpec "Data.LineString.toSeq" testToVector     , testSpec "Data.LineString.combineToVector" testCombineToVector     ]   pure $ testGroup "Data.LineStringTests.Spec" specs@@ -87,29 +87,29 @@ testFromVector =   describe "fromVector" $ do     it "creates a LineString out of a Vector of elements" $ do-      LineString.fromVector (Sequence.fromList [0, 1] :: (Sequence.Seq Int))             `shouldBe` Success (LineString.makeLineString 0 1 Sequence.empty)-      LineString.fromVector (Sequence.fromList [0, 1, 2] :: (Sequence.Seq Int))          `shouldBe` Success (LineString.makeLineString 0 1 (Sequence.fromList [2]))-      LineString.fromVector (Sequence.fromList [0, 1, 2, 4, 5, 0] :: (Sequence.Seq Int)) `shouldBe` Success (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0]))+      LineString.fromSeq (Sequence.fromList [0, 1] :: (Sequence.Seq Int))             `shouldBe` Success (LineString.makeLineString 0 1 Sequence.empty)+      LineString.fromSeq (Sequence.fromList [0, 1, 2] :: (Sequence.Seq Int))          `shouldBe` Success (LineString.makeLineString 0 1 (Sequence.fromList [2]))+      LineString.fromSeq (Sequence.fromList [0, 1, 2, 4, 5, 0] :: (Sequence.Seq Int)) `shouldBe` Success (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0]))     context "when provided with invalid input" $       it "fails" $ do-        LineString.fromVector (Sequence.fromList [] :: (Sequence.Seq Int))  `shouldBe` Failure LineString.VectorEmpty-        LineString.fromVector (Sequence.fromList [0] :: (Sequence.Seq Int)) `shouldBe` Failure LineString.SingletonVector+        LineString.fromSeq (Sequence.fromList [] :: (Sequence.Seq Int))  `shouldBe` Failure LineString.VectorEmpty+        LineString.fromSeq (Sequence.fromList [0] :: (Sequence.Seq Int)) `shouldBe` Failure LineString.SingletonVector  testCombineToVector :: Spec testCombineToVector =   describe "combineToVector" $     it "combine a LineString using PointXY" $ do-      LineString.combineToVector BasicTypes.PointXY (LineString.makeLineString 0 1 Sequence.empty)                   `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1]-      LineString.combineToVector BasicTypes.PointXY (LineString.makeLineString 0 1 (Sequence.fromList [2]))          `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2]-      LineString.combineToVector BasicTypes.PointXY (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0])) `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4, BasicTypes.PointXY 4 5, BasicTypes.PointXY 5 0]+      LineString.combineToSeq BasicTypes.PointXY (LineString.makeLineString 0 1 Sequence.empty)                   `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1]+      LineString.combineToSeq BasicTypes.PointXY (LineString.makeLineString 0 1 (Sequence.fromList [2]))          `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2]+      LineString.combineToSeq BasicTypes.PointXY (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0])) `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4, BasicTypes.PointXY 4 5, BasicTypes.PointXY 5 0]  testToVector :: Spec testToVector =   describe "toVector" $     it "from a LineString to a vector" $ do-      LineString.toVector (LineString.makeLineString 0 1 Sequence.empty)                   `shouldBe` Sequence.fromList ([0, 1] :: [Int])-      LineString.toVector (LineString.makeLineString 0 1 (Sequence.fromList [2]))          `shouldBe` Sequence.fromList ([0, 1, 2] :: [Int])-      LineString.toVector (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0])) `shouldBe` Sequence.fromList ([0, 1, 2, 4, 5, 0] :: [Int])+      LineString.toSeq (LineString.makeLineString 0 1 Sequence.empty)                   `shouldBe` Sequence.fromList ([0, 1] :: [Int])+      LineString.toSeq (LineString.makeLineString 0 1 (Sequence.fromList [2]))          `shouldBe` Sequence.fromList ([0, 1, 2] :: [Int])+      LineString.toSeq (LineString.makeLineString 0 1 (Sequence.fromList [2, 4, 5, 0])) `shouldBe` Sequence.fromList ([0, 1, 2, 4, 5, 0] :: [Int])  -- TODO -- (\xs -> safeLast (fromLineString xs) == Just (lineStringHead xs)) (xs :: LineString Int)
test/Data/LinearRingTests.hs view
@@ -31,7 +31,7 @@ specTests = do   specs <- sequence     [ testSpec "Data.LinearRing.fromList" testFromList-    , testSpec "Data.LinearRing.fromVector" testFromVector+    , testSpec "Data.LinearRing.fromSeq" testFromVector     , testSpec "Data.LinearRing.combineToVector" testCombineToVector     , testSpec "Data.LinearRing.testToVector" testToVector     ]@@ -101,32 +101,32 @@ testFromVector =   describe "fromVector" $ do     it "creates a LinearRing out of a vector of elements" $ do-      LinearRing.fromVector (Sequence.fromList ([0, 1, 0] :: [Int]))         `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 0 Sequence.empty)-      LinearRing.fromVector (Sequence.fromList ([0, 1, 2, 0] :: [Int]))      `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [0]))-      LinearRing.fromVector (Sequence.fromList ([0, 1, 2, 4, 0] :: [Int]))   `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4, 0]))-      LinearRing.fromVector (Sequence.fromList ([0, 1, 2, 4, 5, 0]:: [Int])) `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4, 5, 0]))+      LinearRing.fromSeq (Sequence.fromList ([0, 1, 0] :: [Int]))         `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 0 Sequence.empty)+      LinearRing.fromSeq (Sequence.fromList ([0, 1, 2, 0] :: [Int]))      `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [0]))+      LinearRing.fromSeq (Sequence.fromList ([0, 1, 2, 4, 0] :: [Int]))   `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4, 0]))+      LinearRing.fromSeq (Sequence.fromList ([0, 1, 2, 4, 5, 0]:: [Int])) `shouldBe` Validation.Success (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4, 5, 0]))     context "when provided with invalid input" $       it "fails" $ do-        LinearRing.fromVector (Sequence.fromList [])        `shouldBe` Validation.Failure (LinearRing.VectorTooShort 0 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))-        LinearRing.fromVector (Sequence.fromList [0])       `shouldBe` Validation.Failure (LinearRing.VectorTooShort 1 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))-        LinearRing.fromVector (Sequence.fromList [0, 1])    `shouldBe` Validation.Failure (LinearRing.VectorTooShort 2 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))-        LinearRing.fromVector (Sequence.fromList [0, 1, 2]) `shouldBe` Validation.Failure (LinearRing.FirstNotEqualToLast 0 2 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))+        LinearRing.fromSeq (Sequence.fromList [])        `shouldBe` Validation.Failure (LinearRing.VectorTooShort 0 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))+        LinearRing.fromSeq (Sequence.fromList [0])       `shouldBe` Validation.Failure (LinearRing.VectorTooShort 1 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))+        LinearRing.fromSeq (Sequence.fromList [0, 1])    `shouldBe` Validation.Failure (LinearRing.VectorTooShort 2 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))+        LinearRing.fromSeq (Sequence.fromList [0, 1, 2]) `shouldBe` Validation.Failure (LinearRing.FirstNotEqualToLast 0 2 ListNonEmpty.:| [] :: ListNonEmpty.NonEmpty (LinearRing.VectorToLinearRingError Int))  testCombineToVector :: Spec testCombineToVector =   describe "combineToVector" $     it "combine a LinearRing using tuples" $ do-      LinearRing.combineToVector BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 Sequence.empty)             `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2]-      LinearRing.combineToVector BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4]))    `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4]-      LinearRing.combineToVector BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4,5]))  `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4, BasicTypes.PointXY 4 5]+      LinearRing.combineToSeq BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 Sequence.empty)             `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2]+      LinearRing.combineToSeq BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4]))    `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4]+      LinearRing.combineToSeq BasicTypes.PointXY (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4,5]))  `shouldBe` Sequence.fromList [BasicTypes.PointXY 0 1, BasicTypes.PointXY 1 2, BasicTypes.PointXY 2 4, BasicTypes.PointXY 4 5]  testToVector :: Spec testToVector =   describe "toVector" $     it "from a LinearRing to a vector" $ do-      LinearRing.toVector (LinearRing.makeLinearRing 0 1 0 Sequence.empty)             `shouldBe` Sequence.fromList ([0, 1, 0] :: [Int])-      LinearRing.toVector (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [0]))    `shouldBe` Sequence.fromList ([0, 1, 2, 0] :: [Int])-      LinearRing.toVector (LinearRing.makeLinearRing 0 1 2 (Sequence.fromList [4,0]))  `shouldBe` Sequence.fromList ([0, 1, 2, 4, 0] :: [Int])+      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])   -- TODO