Since a KM native action doesn't exist, I created this plugin that executes Haskell code with parameters. This is currently in experimental phase. I hope this gets natively implemented someday.
Author:
Gabriel @unlocked2412
Version 0.01
Execute a Haskell Script with Arguments.zip (9.8 KB)
Requirements:
Haskell downloads:
(runhaskell
program should be at: /usr/local/bin/runhaskell
)
The script should have an interact' :: (String -> String) -> IO ()
function to accept those arguments.
Notes:
I used some of the wonderful functions in the prelude-jxa
library by Rob Trew. Could be found here: https://github.com/RobTrew/prelude-jxa
The plugin currently writes a temporary .hs
file.
A Haskell playground could be found here (below Try it):
EDIT:
Example:
This example uses the modified interact'
function.
Retrieving the second item of a KM Array:
This new version doesn't error if Arg
has parenthesis (due to shell interpretation of parenthesis).
Version 0.02
Execute a Haskell Script with Arguments.zip (9.7 KB)
Example:
1 Like
Version 0.04
- changed icon and minor edits.
Execute a Haskell Script with Arguments.zip (11.8 KB)
Note: Haskell platform must be installed in the machine.
Version 0.05
- Added a parameter
Path
to the Plug-in where the user can place the location of runhaskell
executable.
- If that parameter is left blank, the Plug-in will test common locations where the executable could be found.
Execute a Haskell Script with Arguments.zip (10.4 KB)
Note: Haskell platform must be installed in the machine.
Version 0.1
- Added a parameter
ghc_arg
where the user can place dependencies (packages).
Execute a Haskell Script with Arguments.zip (11.2 KB)
1 Like
You seem to have a readme.md from one of my old plugins in there (Join a KM Array with a delimiter
)
Perhaps worth replacing with one which references this plugin ?
Version 0.2
- Updated documentation and changed field names.
Execute a Haskell Script with Arguments.zip (11.2 KB)
Version 0.5
- The internals of the plug-in have been modified. Now, a shell script is used.
Execute a Haskell Script with Arguments.zip (9.8 KB)
Version 0.7
- The shell script doesn't create an intermediate temporary file. Now, directly executes the Haskell script with supplied argument.
Execute a Haskell Script with Arguments.zip (10.4 KB)