| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Language.Futhark.Interpreter.IO
Description
IO operations exposed through the interpreter.
Documentation
The IO operation to perform. The idea of splitting it out into a type like this is to enforce some kind of auditing.
safeIO :: IOOp -> Bool Source #
Is this IO operation something that we allow in untrusted code, namely
script input. This is not a completely firm security boundary, as even safe
IO operations allow reading of arbitrary files, but the idea is to make it
possible to benchmark untrusted Futhark programs (assuming you also use
--safe, of course).
data IOIntrinsic (m :: Type -> Type) Source #
An IO intrinsic, which determines its operation from the type at which it is instantiated and its arguments, of which the first is always a file name. The file name is fetched in full before the intrinsic sees it, but any other argument is passed as-is, and so may contain references to values residing on a server.
determineIO :: forall (m :: Type -> Type). Monad m => Text -> Maybe (IOIntrinsic m) Source #
Determine which IO operation this is.
If you want to add a new one, then remember to also add it as an intrinsic in the type checker, and probably also to the prelude.