Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Geos a
- runGeos :: Geos a -> a
- runGeosE :: Geos a -> Either String a
- runGeosM :: Geos a -> Maybe a
- throwIfZero :: (Eq a, Num a, MonadError e m) => (a -> e) -> m a -> m a
- throwIfZero' :: (Eq a, Num a, Monad m) => (a -> e) -> m a -> m (Either e a)
- throwIfNull :: MonadError String m => String -> m (Ptr a) -> m (Ptr a)
- throwIfNull' :: Monad m => String -> m (Ptr a) -> m (Either String (Ptr a))
- throwIf :: (Eq a, MonadError e m) => (a -> Bool) -> (a -> e) -> m a -> m a
- throwIf' :: (Eq a, Monad m, MonadError e me) => (a -> Bool) -> (a -> e) -> m a -> m (me a)
- withGeos :: (GEOSContextHandle_t -> IO a) -> Geos a
- withGeos' :: (GEOSContextHandle_t -> IO (Either String a)) -> Geos a
- mkErrorMessage :: Show a => String -> a -> String
- marshallInt :: (Integral i, Storable i) => Ptr i -> IO Int
- marshallDouble :: (Real r, Storable r) => Ptr r -> IO Double
- geosUnit :: Geos ()
Documentation
Geos is the core context for performing geometric calculations. It handles the foreign function interface as well as error handling. All underlying geos exceptions are represented by a String.
runGeos :: Geos a -> a Source #
Unsafe function for performing a geos calculation. Errors will cause runtime exceptions.
runGeosE :: Geos a -> Either String a Source #
A safe function for performing a geos calculation and returning an Either String a. Exceptions are reprsented as `Left String`
runGeosM :: Geos a -> Maybe a Source #
A safe function for performing a geos calculation and returning a Maybe. Exceptions will be represented as Nothing.
throwIfZero :: (Eq a, Num a, MonadError e m) => (a -> e) -> m a -> m a Source #