Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.ExtractHs

Description

A library to collect definitions from haskell source and collect them into an output source file.

Synopsis

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.

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

util