definition: |
setFormIDsInFlatCurry :: Options -> String -> IO () setFormIDsInFlatCurry opts mname = do lookupModuleSourceInLoadPath mname >>= maybe (error $ "Module '" ++ mname ++ "' not found in load path!") attachFormIDsInProg where attachFormIDsInProg (mdir,_) = do when (optVerb opts > 1) $ putStr $ "Reading FlatCurry of module '" ++ mname ++ "'..." (Prog name imps types funcs ops) <- readFlatCurry mname putStrLnInter opts "done!" let newflatname = flatCurryFileName (mdir </> mname) ++ transSuffix tprog = Prog name imps types (map transFunc funcs) ops putStrLnInter opts $ "Writing transformed FlatCurry file..." writeFlatCurryFile newflatname tprog copyFlatCurryInDir opts mdir mname transFunc fd@(Func fn ar vis te rl) = if isFormDefType te then Func fn ar vis te (addID rl) else fd where addID (External _) = error "Externally defined HTML form!" addID (Rule vs exp) = Rule vs (Comb FuncCall ("HTML.Base","setFormDefId") [string2FC (showQName fn), exp]) isFormDefType texp = case texp of TCons tc [_] -> tc == formDefTypeName _ -> False |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
------------------------------------------------------------------------------ --- Transforms a FlatCurry file by setting IDs in all form definitions. |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_) |-> _} |
name: |
setFormIDsInFlatCurry |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
C2C.Options.Options -> String -> Prelude.IO () |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |