 module OSGeo.GDAL.Internal (
     GDAL
   , runGDAL
+  , gdalForkIO
   , GDALType
   , Datatype (..)
   , GDALException (..)

) where

import Control.Applicative ((<$>), (<*>))
import Control.Exception ( bracket, throw, Exception(..), SomeException
                         , evaluate)
import Control.DeepSeq (NFData, force)
import Control.Monad (liftM, liftM2, foldM)
import Control.Monad.Trans.Resource (ResourceT, runResourceT, register)
import Control.Monad.IO.Class (MonadIO(..))

import Data.Int (Int16, Int32)

  registerAllDrivers
  runResourceT (a >>= liftIO . evaluate . force)

gdalForkIO :: GDAL s () -> GDAL s ThreadId
gdalForkIO (GDAL a) = GDAL (resourceForkIO a)

data GDALException = GDALException !Error !String
                   | InvalidType
