Copyright | (C) 2014-2018 HS-GeoJSON Project |
---|---|
License | BSD-style (see the file LICENSE.md) |
Maintainer | Andrew Newman |
Safe Haskell | None |
Language | Haskell2010 |
Refer to the GeoJSON Spec http://geojson.org/geojson-spec.html#linestring
A LinearString is a List with at least 2 elements
Synopsis
- data LineString a
- data ListToLineStringError
- fromLineString :: LineString a -> [a]
- fromList :: Validate v => [a] -> v ListToLineStringError (LineString a)
- makeLineString :: a -> a -> [a] -> LineString a
- lineStringHead :: LineString a -> a
- lineStringLast :: LineString a -> a
- lineStringLength :: LineString a -> Int
Type
data LineString a Source #
a LineString has at least 2 elements
Instances
data ListToLineStringError Source #
When converting a List to a LineString, here is a list of things that can go wrong:
- The list was empty
- The list only had one element
Instances
Eq ListToLineStringError Source # | |
Defined in Data.LineString (==) :: ListToLineStringError -> ListToLineStringError -> Bool # (/=) :: ListToLineStringError -> ListToLineStringError -> Bool # | |
Show ListToLineStringError Source # | |
Defined in Data.LineString showsPrec :: Int -> ListToLineStringError -> ShowS # show :: ListToLineStringError -> String # showList :: [ListToLineStringError] -> ShowS # |
Functions
fromLineString :: LineString a -> [a] Source #
This function converts it into a list and appends the given element to the end.
fromList :: Validate v => [a] -> v ListToLineStringError (LineString a) Source #
creates a LineString out of a list of elements, if there are enough elements (needs at least 2) elements
:: a | The first element |
-> a | The second element |
-> [a] | The rest of the optional elements |
-> LineString a |
Creates a LineString
makeLineString x y zs
creates a LineString
homomorphic to the list [x, y] ++ zs
lineStringHead :: LineString a -> a Source #
returns the element at the head of the string
lineStringLast :: LineString a -> a Source #
returns the last element in the string
lineStringLength :: LineString a -> Int Source #
returns the number of elements in the list, including the replicated element at the end of the list.