Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Haskell code for interacting with a Futhark server program (a
program compiled with --server
).
Synopsis
- data Server
- withServer :: FilePath -> [FilePath] -> (Server -> IO a) -> IO a
- data CmdFailure = CmdFailure {
- failureLog :: [Text]
- failureMsg :: [Text]
- type VarName = Text
- type TypeName = Text
- type EntryName = Text
- cmdRestore :: Server -> FilePath -> [(VarName, TypeName)] -> IO (Maybe CmdFailure)
- cmdStore :: Server -> FilePath -> [VarName] -> IO (Maybe CmdFailure)
- cmdCall :: Server -> EntryName -> [VarName] -> [VarName] -> IO (Either CmdFailure [Text])
- cmdFree :: Server -> [VarName] -> IO (Maybe CmdFailure)
- cmdRename :: Server -> VarName -> VarName -> IO (Maybe CmdFailure)
- cmdInputs :: Server -> EntryName -> IO (Either CmdFailure [TypeName])
- cmdOutputs :: Server -> EntryName -> IO (Either CmdFailure [TypeName])
- cmdClear :: Server -> IO (Maybe CmdFailure)
- cmdReport :: Server -> IO (Either CmdFailure [Text])
- cmdMaybe :: (MonadError Text m, MonadIO m) => IO (Maybe CmdFailure) -> m ()
- cmdEither :: (MonadError Text m, MonadIO m) => IO (Either CmdFailure a) -> m a
Documentation
withServer :: FilePath -> [FilePath] -> (Server -> IO a) -> IO a Source #
Start a server, execute an action, then shut down the server.
data CmdFailure Source #
The command failed, and this is why. The first Text
is any
output before the failure indincator, and the second Text is the
output after the indicator.
CmdFailure | |
|
Instances
Eq CmdFailure Source # | |
Defined in Futhark.Server (==) :: CmdFailure -> CmdFailure -> Bool # (/=) :: CmdFailure -> CmdFailure -> Bool # | |
Ord CmdFailure Source # | |
Defined in Futhark.Server compare :: CmdFailure -> CmdFailure -> Ordering # (<) :: CmdFailure -> CmdFailure -> Bool # (<=) :: CmdFailure -> CmdFailure -> Bool # (>) :: CmdFailure -> CmdFailure -> Bool # (>=) :: CmdFailure -> CmdFailure -> Bool # max :: CmdFailure -> CmdFailure -> CmdFailure # min :: CmdFailure -> CmdFailure -> CmdFailure # | |
Show CmdFailure Source # | |
Defined in Futhark.Server showsPrec :: Int -> CmdFailure -> ShowS # show :: CmdFailure -> String # showList :: [CmdFailure] -> ShowS # |
cmdRestore :: Server -> FilePath -> [(VarName, TypeName)] -> IO (Maybe CmdFailure) Source #
cmdOutputs :: Server -> EntryName -> IO (Either CmdFailure [TypeName]) Source #
cmdMaybe :: (MonadError Text m, MonadIO m) => IO (Maybe CmdFailure) -> m () Source #
Turn a Maybe
-producing command into a monadic action.
cmdEither :: (MonadError Text m, MonadIO m) => IO (Either CmdFailure a) -> m a Source #
Turn an Either
-producing command into a monadic action.