CurryInfo: propertyfile-3.0.0 / Data.PropertyFile.readPropertyFile

definition: Info
 
readPropertyFile :: String -> IO [(String,String)]
readPropertyFile file = do
  pfexists <- doesFileExist file
  if pfexists
   then do
     rcs <- openFile file ReadMode >>= hGetContents -- avoid open file handles
     return $ splitEqs . filter (\l->not (null l) && isAlpha (head l))
                       . lines $ rcs
   else return []
 where
  splitEqs [] = []
  splitEqs (eq:eqs) = case break (=='=') eq of
     (prop,_:val) -> (prop,val) : splitEqs eqs
     _            -> splitEqs eqs
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
---------------------------------------------------------------------------
Reads a property file and returns the list of properties.
Returns empty list if the property file does not exist.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> _}
name: Info
 readPropertyFile
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> Prelude.IO [(String, 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