| Copyright | (c) Mattias Jakobsson 2015 |
|---|---|
| License | GPL-3 |
| Maintainer | mjakob422@gmail.com |
| Stability | unstable |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Grib
Description
- 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
Arguments
| :: 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
IOErrorraised byopenBinaryCFile; - any
GribErrorraised bygribHandleNewFromFile; or - any other exception raised by the given
GribIOaction.
The reader environment of GribIO containing the current
filename, a GribHandle, and its index in the file.
Get values
These operations may fail with:
isGribExceptionGribNotFoundif the key is missing.
Set values
These operations may fail with:
isGribExceptionGribNotFoundif the key is missing; orisGribExceptionGribReadOnlyif 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.