| language-c-0.3.1.1: Analysis and generation of C code | Source code | Contents | Index
Language.C.Data.InputStream |
Portability | ghc
Stability | experimental
Maintainer | benedikt.huber@gmail.com
Description
Compile time input abstraction for the parser. Supports either ByteString or String.
Synopsis
type InputStream = ByteString
readInputStream :: FilePath -> IO InputStream
inputStreamToString :: InputStream -> String
inputStreamFromString :: String -> InputStream
takeChar :: InputStream -> (Char, InputStream)
inputStreamEmpty :: InputStream -> Bool
takeChars :: Int -> InputStream -> [Char]
countLines :: InputStream -> Int
Documentation
type InputStream = ByteString | Source
readInputStream :: FilePath -> IO InputStream | Source
read a file into an `InputStream`
inputStreamToString :: InputStream -> String | Source
convert `InputStream` to `String`
inputStreamFromString :: String -> InputStream | Source
convert a `String` to an `InputStream`
takeChar :: InputStream -> (Char, InputStream) | Source
`(c,is') = takeChar is` reads and removes the first character `c` from the `InputStream` `is`
inputStreamEmpty :: InputStream -> Bool | Source
return `True` if the given input stream is empty
takeChars :: Int -> InputStream -> [Char] | Source
`str = takeChars n is` returns the first `n` characters of the given input stream, without removing them
countLines :: InputStream -> Int | Source
`countLines` returns the number of text lines in the given `InputStream`
Produced by Haddock version 2.4.2