CurryInfo: currydoc-4.0.0 / CurryDoc.Read.classifyLine

definition: Info
 
classifyLine :: String -> SourceLine
classifyLine line
 | take 3 line == "---"  && all isSpace (drop 3 line) = Comment "" --"<br/>"
 | take 4 line == "--- " && head (drop 4 line) /= '-' = Comment (drop 4 line)
 | take 7 line == "module "  = ModDef
 | take 7 line == "import "  = ModDef
 | otherwise = let id1 = getFirstId line
                in if null id1
                    then OtherLine
                    else if id1 == "data" || id1 == "type" || id1 == "newtype"
                          then DataDef (getDatatypeName line)
                          else if "'default" `isSuffixOf` id1
                                then OtherLine -- ignore default rules
                                else FuncDef id1
 where
   getDatatypeName = takeWhile isIdChar . dropWhile (==' ') . dropWhile isIdChar
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
classify a line of the source program:
here we replace blank line comments by a "breakline" tag
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> {Comment,DataDef,FuncDef,ModDef,OtherLine}}
name: Info
 classifyLine
precedence: Info
 no precedence defined
result-values: Info
 {Comment,DataDef,FuncDef,ModDef,OtherLine}
signature: Info
 String -> SourceLine
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term