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: