definition:
|
readAbstractCurryFile :: String -> IO CurryProg
readAbstractCurryFile filename = do
exacy <- doesFileExist filename
if exacy
then readExistingACY filename
else do let subdirfilename = inCurrySubdir filename
exdiracy <- doesFileExist subdirfilename
if exdiracy
then readExistingACY subdirfilename
else error ("EXISTENCE ERROR: AbstractCurry file '"++filename++
"' does not exist")
where
readExistingACY fname = do
filecontents <- readFile fname
let (line1,lines) = break (=='\n') filecontents
if line1 == "{- "++version++" -}"
then case readACYString lines of
Just p -> return p
Nothing -> error $ "Could not parse AbstractCurry file '" ++
filename ++ "': no parse"
else error $ "AbstractCurry: incompatible file found: "++fname
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
documentation:
|
--- I/O action which reads an AbstractCurry program from a file in ".acy"
--- format. In contrast to <CODE>readCurry</CODE>, this action does not parse
--- a source program. Thus, the argument must be the name of an existing
--- file (with suffix ".acy") containing an AbstractCurry program in ".acy"
--- format and the result is a Curry term representing this program.
--- It is currently predefined only in Curry2Prolog.
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_) |-> _}
|
name:
|
readAbstractCurryFile
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
String -> Prelude.IO AbstractCurry.Types.CurryProg
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|