packages feed

futhark-server 1.3.1.0 → 1.3.2.0

raw patch · 3 files changed

+22/−2 lines, 3 filesdep ~text

Dependency ranges changed: text

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for futhark-server +## 1.3.2.0 -- 2026-03-15++* Added `cmdNewArray`, `cmdRank`, `cmdSet`.+ ## 1.3.1.0 -- 2026-03-10  * Added `FieldName`.
futhark-server.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               futhark-server-version:            1.3.1.0+version:            1.3.2.0 synopsis: Client implementation of the Futhark server protocol.  description: Provides an easy way to interact with a running Futhark
src/Futhark/Server.hs view
@@ -60,8 +60,11 @@     cmdType,      -- * Arrays+    cmdNewArray,+    cmdRank,     cmdElemtype,     cmdShape,+    cmdSet,     cmdIndex,      -- ** Records@@ -488,6 +491,14 @@ cmdType :: Server -> VarName -> IO (Either CmdFailure TypeName) cmdType s v = sendCommandSL s "type" [v] +-- | @new_array v0 t s0 ... sN-1 v1 ... vM@+cmdNewArray :: Server -> VarName -> TypeName -> [Int] -> [VarName] -> IO (Maybe CmdFailure)+cmdNewArray s var0 t sizes vars = helpCmd s "new_array" $ var0 : t : map T.show sizes ++ vars++-- | @rank t@+cmdRank :: Server -> TypeName -> IO (Either CmdFailure Int)+cmdRank s t = fmap (read . T.unpack) <$> sendCommandSL s "rank" [t]+ -- | @elemtype t@ cmdElemtype :: Server -> TypeName -> IO (Either CmdFailure TypeName) cmdElemtype s t = sendCommandSL s "elemtype" [t]@@ -496,10 +507,15 @@ cmdShape :: Server -> VarName -> IO (Either CmdFailure [Int]) cmdShape s v = fmap (map (read . T.unpack) . T.words) <$> sendCommandSL s "shape" [v] +-- | @set v0 v1 i0 ... iN-1@+cmdSet :: Server -> VarName -> VarName -> [Int] -> IO (Maybe CmdFailure)+cmdSet s v0 v1 is =+  helpCmd s "set" $ [v0, v1] <> map T.show is+ -- | @index v0 v1 i0 ... iN-1@ cmdIndex :: Server -> VarName -> VarName -> [Int] -> IO (Maybe CmdFailure) cmdIndex s v0 v1 is =-  helpCmd s "index" $ [v0, v1] <> map (T.pack . show) is+  helpCmd s "index" $ [v0, v1] <> map T.show is  -- | @fields type@ cmdFields :: Server -> TypeName -> IO (Either CmdFailure [Field])