CurryInfo: benchmark-papers-3.0.0 / ExecuteBenchmarkPaper.extractCurryCode

definition: Info
 
extractCurryCode :: Handle -> String -> IO [String]
extractCurryCode _ [] = return []
extractCurryCode hc (c:cs) = case c of
  '\\' -> if take 9 cs == "runcurry{"
          then let (s,ds) = break (=='}') (drop 9 cs)
                in if null ds
                   then error ("UNCLOSED MACRO: " ++ c:take 50 cs ++ "...")
                   else do xs <- extractCurryCode hc (tail ds)
                           return (s:xs)
          else extractCurryCode hc cs
  '\n' -> if not (null cs) && head cs == '%'
          then skipLine cs
          else if take 17 cs == "\\begin{curryprog}"
               then copyCurryCode hc (drop 17 cs) >>=
                    extractCurryCode hc
               else extractCurryCode hc cs
  _    -> extractCurryCode hc cs
 where
  skipLine [] = return []
  skipLine (d:ds) = if d=='\n'
                    then extractCurryCode hc (d:ds)
                    else skipLine ds
demand: Info
 argument 2
deterministic: Info
 deterministic operation
documentation: Info
 
Extract \begin{curryprog}...\end{curryprog} and \runcurry{...} from a text.
The "{...}" must not contain any further curly brackets.
The extracted `curryprog` code is written to the handle.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{[]}) |-> _ || (_,{:}) |-> _}
name: Info
 extractCurryCode
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 System.IO.Handle -> String -> Prelude.IO [String]
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term