Copyright | (c) Mattias Jakobsson 2015 |
---|---|
License | GPL-3 |
Maintainer | mjakob422@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- type GribIO = ReaderT GribEnv IO
- runGribIO :: FilePath -> GribIO a -> IO [a]
- runGribIO_ :: FilePath -> GribIO a -> IO ()
- data GribEnv
- getDouble :: Key -> GribIO Double
- getLong :: Key -> GribIO Int
- getString :: Key -> GribIO String
- getValues :: GribIO [Double]
- setDouble :: Key -> Double -> GribIO ()
- setLong :: Key -> Int -> GribIO ()
- setString :: Key -> String -> GribIO ()
- setValues :: [Double] -> GribIO ()
- getFilename :: GribIO FilePath
- getIndex :: GribIO Int
- getHandle :: GribIO GribHandle
- liftIO :: MonadIO m => forall a. IO a -> m a
The GRIB Monad
:: FilePath | a path to a GRIB file |
-> GribIO a | an action to take on each GRIB message in the file |
-> IO [a] | the results of the actions |
Run an action on each GRIB message in a file and collect the results.
This operation may fail with:
- any
IOError
raised byopenBinaryCFile
; - any
GribError
raised bygribHandleNewFromFile
; or - any other exception raised by the given
GribIO
action.
The reader environment of GribIO
containing the current
filename, a GribHandle
, and its index in the file.
Get values
These operations may fail with:
isGribException
GribNotFound
if the key is missing.
Set values
These operations may fail with:
isGribException
GribNotFound
if the key is missing; orisGribException
GribReadOnly
if the key is read-only.
Utilities
getFilename :: GribIO FilePath Source
Return the name of the file being read.
getHandle :: GribIO GribHandle Source
Return the current GribHandle
for use with the Raw
GRIB API bindings.