Module RunCurry

This program implements the runcurry command that allows to run a Curry program without explicitly invoking the REPL.

Basically, it has three modes of operation:

  • execute the main operation of a Curry program whose file name is provided as an argument
  • execute the main operation of a Curry program whose program text comes from the standard input
  • execute the main operation of a Curry program whose program text is in a script file (starting with #!/usr/bin/env runcurry). If the script file contains the line #jit, it is compiled and saved as an executable so that it is faster executed when called the next time.

Note that the runcurry command is intended to compile simple Curry programs which use only base libraries but not other Curry packages. Otherwise, one has to adapt the constant replOpts below.

Author: Michael Hanus

Version: March 2024

Summary of exported operations:

replOpts :: String  Deterministic 
main :: IO ()  Non-deterministic 
usageMsg :: String  Deterministic 
checkFirstArg :: [String] -> [String] -> IO ()  Deterministic 
execOrJIT :: String -> String -> String -> [String] -> [String] -> IO Int  Deterministic 
isHashJITOption :: String -> Bool  Deterministic 
noHashLine :: String -> Bool  Deterministic 
getNewProgramName :: IO String  Deterministic 
isExecutable :: String -> IO Bool  Deterministic 
saveCurryProgram :: String -> [String] -> String -> IO Int  Deterministic 
execCurryProgram :: String -> [String] -> [String] -> IO Int  Deterministic 
execAndDeleteCurryProgram :: String -> [String] -> [String] -> IO Int  Deterministic 
stripSpaces :: String -> String  Deterministic 

Exported operations:

replOpts :: String  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

main :: IO ()  Non-deterministic 

usageMsg :: String  Deterministic 

checkFirstArg :: [String] -> [String] -> IO ()  Deterministic 

execOrJIT :: String -> String -> String -> [String] -> [String] -> IO Int  Deterministic 

isHashJITOption :: String -> Bool  Deterministic 

noHashLine :: String -> Bool  Deterministic 

getNewProgramName :: IO String  Deterministic 

isExecutable :: String -> IO Bool  Deterministic 

saveCurryProgram :: String -> [String] -> String -> IO Int  Deterministic 

execCurryProgram :: String -> [String] -> [String] -> IO Int  Deterministic 

execAndDeleteCurryProgram :: String -> [String] -> [String] -> IO Int  Deterministic 

stripSpaces :: String -> String  Deterministic