geos-0.4.1: Bindings for GEOS.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Geos.Raw.Base

Synopsis

Documentation

data Geos a Source #

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.

Instances

Monad Geos Source # 

Methods

(>>=) :: Geos a -> (a -> Geos b) -> Geos b #

(>>) :: Geos a -> Geos b -> Geos b #

return :: a -> Geos a #

fail :: String -> Geos a #

Functor Geos Source # 

Methods

fmap :: (a -> b) -> Geos a -> Geos b #

(<$) :: a -> Geos b -> Geos a #

Applicative Geos Source # 

Methods

pure :: a -> Geos a #

(<*>) :: Geos (a -> b) -> Geos a -> Geos b #

(*>) :: Geos a -> Geos b -> Geos b #

(<*) :: Geos a -> Geos b -> Geos a #

MonadError String Geos Source # 

Methods

throwError :: String -> Geos a

catchError :: Geos a -> (String -> Geos a) -> Geos a

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 #

throwIfZero' :: (Eq a, Num a, Monad m) => (a -> e) -> m a -> m (Either e a) Source #

throwIfNull :: MonadError String m => String -> m (Ptr a) -> m (Ptr a) Source #

throwIfNull' :: Monad m => String -> m (Ptr a) -> m (Either String (Ptr a)) Source #

throwIf :: (Eq a, MonadError e m) => (a -> Bool) -> (a -> e) -> m a -> m a Source #

throwIf' :: (Eq a, Monad m, MonadError e me) => (a -> Bool) -> (a -> e) -> m a -> m (me a) Source #