module H3.DirectedEdges
( isValidDirectedEdge
, directedEdgeToCells
, originToDirectedEdges
, areNeighborCells
, cellsToDirectedEdge
, getDirectedEdgeOrigin
, getDirectedEdgeDestination
, directedEdgeToBoundary
) where
import H3.Internal.H3Api
( LatLng
, H3ErrorCodes
, H3Index
, c2hs_areNeighborCells
, c2hs_cellsToDirectedEdge
, c2hs_getDirectedEdgeOrigin
, c2hs_getDirectedEdgeDestination
, c2hs_directedEdgeToBoundary
)
import H3.Internal.FFI
( isValidDirectedEdge
, hsDirectedEdgeToCells
, hsOriginToDirectedEdges
)
import H3.Internal.Utils (toEither)
directedEdgeToCells :: H3Index -> Either H3ErrorCodes [H3Index]
directedEdgeToCells :: H3Index -> Either H3ErrorCodes [H3Index]
directedEdgeToCells = (H3Error, [H3Index]) -> Either H3ErrorCodes [H3Index]
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, [H3Index]) -> Either H3ErrorCodes [H3Index])
-> (H3Index -> (H3Error, [H3Index]))
-> H3Index
-> Either H3ErrorCodes [H3Index]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, [H3Index])
hsDirectedEdgeToCells
originToDirectedEdges :: H3Index -> Either H3ErrorCodes [H3Index]
originToDirectedEdges :: H3Index -> Either H3ErrorCodes [H3Index]
originToDirectedEdges = (H3Error, [H3Index]) -> Either H3ErrorCodes [H3Index]
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, [H3Index]) -> Either H3ErrorCodes [H3Index])
-> (H3Index -> (H3Error, [H3Index]))
-> H3Index
-> Either H3ErrorCodes [H3Index]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, [H3Index])
hsOriginToDirectedEdges
areNeighborCells :: H3Index -> H3Index -> Either H3ErrorCodes Bool
areNeighborCells :: H3Index -> H3Index -> Either H3ErrorCodes Bool
areNeighborCells H3Index
origin = (H3Error, Bool) -> Either H3ErrorCodes Bool
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, Bool) -> Either H3ErrorCodes Bool)
-> (H3Index -> (H3Error, Bool))
-> H3Index
-> Either H3ErrorCodes Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> H3Index -> (H3Error, Bool)
c2hs_areNeighborCells H3Index
origin
cellsToDirectedEdge :: H3Index
-> H3Index
-> Either H3ErrorCodes H3Index
cellsToDirectedEdge :: H3Index -> H3Index -> Either H3ErrorCodes H3Index
cellsToDirectedEdge H3Index
origin = (H3Error, H3Index) -> Either H3ErrorCodes H3Index
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, H3Index) -> Either H3ErrorCodes H3Index)
-> (H3Index -> (H3Error, H3Index))
-> H3Index
-> Either H3ErrorCodes H3Index
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> H3Index -> (H3Error, H3Index)
c2hs_cellsToDirectedEdge H3Index
origin
getDirectedEdgeOrigin :: H3Index -> Either H3ErrorCodes H3Index
getDirectedEdgeOrigin :: H3Index -> Either H3ErrorCodes H3Index
getDirectedEdgeOrigin = (H3Error, H3Index) -> Either H3ErrorCodes H3Index
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, H3Index) -> Either H3ErrorCodes H3Index)
-> (H3Index -> (H3Error, H3Index))
-> H3Index
-> Either H3ErrorCodes H3Index
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, H3Index)
c2hs_getDirectedEdgeOrigin
getDirectedEdgeDestination :: H3Index -> Either H3ErrorCodes H3Index
getDirectedEdgeDestination :: H3Index -> Either H3ErrorCodes H3Index
getDirectedEdgeDestination = (H3Error, H3Index) -> Either H3ErrorCodes H3Index
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, H3Index) -> Either H3ErrorCodes H3Index)
-> (H3Index -> (H3Error, H3Index))
-> H3Index
-> Either H3ErrorCodes H3Index
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, H3Index)
c2hs_getDirectedEdgeDestination
directedEdgeToBoundary :: H3Index -> Either H3ErrorCodes [LatLng]
directedEdgeToBoundary :: H3Index -> Either H3ErrorCodes [LatLng]
directedEdgeToBoundary = (H3Error, [LatLng]) -> Either H3ErrorCodes [LatLng]
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, [LatLng]) -> Either H3ErrorCodes [LatLng])
-> (H3Index -> (H3Error, [LatLng]))
-> H3Index
-> Either H3ErrorCodes [LatLng]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, [LatLng])
c2hs_directedEdgeToBoundary