CurryInfo: xmldata-3.0.0 / Data2Xml.derive

definition:
derive :: [Option] -> IO ()
derive []                   = printUsage
derive (LowCase     : _  )  = printUsage
derive (OutDir _    : _  )  = printUsage
derive (FileName fn : opts) = flip runModuleAction fn $ \mname -> do
  CurryProg modName _ _ _  _ ts _ _ <- readCurry mname
  let (specials,types) = if isPrelude modName
                           then (specialFuncs opts, filterSpecials ts)
                           else ([],ts)
      progName = transModName mname
      impTypes = maybeString $ nub $ filter ((/=modName) .fst)
                             $ concatMap requiredTypesTypeDecl types
  imports <- importTypes modName impTypes
  let outfile = outDirOf opts </> progName ++ ".curry"
      outprog = CurryProg
                  progName (nub $ ["XML",mname] ++ imports) Nothing [] [] []
                  (map (mkType2Xml opts) types ++
                   map (mkXml2Type opts) types ++ specials)
                  []
  writeFile outfile $ nopatwarn ++ showCProg outprog
  putStrLn $ "Now you can import: " ++ outfile
 where
  nopatwarn = "{-# OPTIONS_FRONTEND -Wno-incomplete-patterns #-}\n\n"
demand:
argument 1
deterministic:
deterministic operation
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{({[]}) |-> _ || ({:}) |-> _}
name:
derive
precedence:
no precedence defined
result-values:
_
signature:
[Option] -> Prelude.IO ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term