Safe Haskell | Safe-Inferred |
---|
A library to collect definitions from haskell source and collect them into an output source file.
Synopsis
- type Error = Text
- type Warning = Text
- process :: [String] -> (Text -> a) -> (IO.FilePath -> Map IO.FilePath a -> Either Error ([Warning], Text)) -> IO.IO ()
- header :: String -> Text
- extractFiles :: (Text -> a) -> [IO.FilePath] -> IO.IO (Map IO.FilePath a)
- typeDeclarations :: Text -> [(Int, (Text, Text))]
- stripComments :: Text -> Text
- breakOnFirst :: Text -> Text -> Text -> (Text, Text)
- moduleDeclaration :: IO.FilePath -> Text
- makeImport :: IO.FilePath -> Text
- pathToModule :: IO.FilePath -> Text
- die :: Text -> IO.IO a
Documentation
process :: [String] -> (Text -> a) -> (IO.FilePath -> Map IO.FilePath a -> Either Error ([Warning], Text)) -> IO.IO () Source #
Extract from haskell source files, and generate output based on it.
extractFiles :: (Text -> a) -> [IO.FilePath] -> IO.IO (Map IO.FilePath a) Source #
extract
typeDeclarations :: Text -> [(Int, (Text, Text))] Source #
This is just barely enough of a parser to work for my purposes.
stripComments :: Text -> Text Source #
This will be fooled by a {- or -} inside a string. I don't strip -- comments because the extract functions look for left justified text.
breakOnFirst :: Text -> Text -> Text -> (Text, Text) Source #
Like Text.breakOn
, but break either of two things.
generate
moduleDeclaration :: IO.FilePath -> Text Source #
makeImport :: IO.FilePath -> Text Source #
pathToModule :: IO.FilePath -> Text Source #