definition: |
tryReadCurryFile :: String -> IO (Either String CurryProg) tryReadCurryFile m = do mbSrc <- lookupModuleSourceInLoadPath m case mbSrc of Nothing -> cancel $ "Source module '" ++ m ++ "' not found" Just (_,srcFile) -> do callFrontendWithParams ACY (setQuiet True defaultParams) m mbFn <- getLoadPathForModule m >>= findFileWithSuffix (abstractCurryFileName m) [""] case mbFn of Nothing -> cancel $ "AbstractCurry module '" ++ m ++ "' not found" Just fn -> do ctime <- getModificationTime srcFile ftime <- getModificationTime fn if ctime > ftime then cancel $ "Source file '" ++ srcFile ++ "' is newer than AbstractCurry file '" ++ fn ++ "'" else do mbProg <- tryParse fn case mbProg of Left err -> cancel err Right p -> return (Right p) where cancel str = return (Left str) |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_) |-> _} |
name: |
tryReadCurryFile |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
String -> Prelude.IO (Prelude.Either String AbstractCurry.Types.CurryProg) |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |