config-parser alternatives and similar packages
Based on the "Text" category.
Alternatively, view config-parser alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
text-offset
Emits code crossreference data for Haskell sources. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
servant-checked-exceptions
type-level errors for Servant APIs. -
pretty-show
Tools for working with derived Show instances in Haskell. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
hyphenation
Knuth-Liang Hyphenation for Haskell based on TeX hyphenation files
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of config-parser or a related project?
README
Text.ConfigParser
This is yet another entry in Haskell's enourmous collection of config-file parsing libraries. It lacks many of the bells and whistles of other config-file parsing libraries, such as hierarchical sections and on-the-fly reloading. On the other hand, it has a combination of features I was unable to find in other libraries:
- Keys and values are parsed with configurable parsec parsers, resulting in flexible syntax and pretty error messages.
- Custom parsers can be created with parsec to handle values of any type.
- Keys that aren't explicitly handled result in parse errors.
If you don't need all of these features, there are probably better libraries out there for you. If you're free to use its idiosyncratic file format, the config-value library, in particular, is excelent.
By default, this library parses flat config like the following:
a_string = "blah, blah, blah\nmore blah"
a_number = 9001
a_list = [1,2,3,4,5]
# This is a comment
If you wanted to parse the above file, saved as @./[email protected], you might do so as follows:
import Text.ConfigParser
cp :: ConfigParser (Maybe String, Maybe Integer, [Integer])
cp = configParser (Nothing, Nothing, [])
[ ConfigOption
{ key = "a_string"
, required = True
, parser = string
, action = \s (_,n,ns) -> (Just s, n, ns)
}
, ConfigOption
{ key = "a_number"
, required = True
, parser = integer
, action = \n (s,_,ns) -> (s, Just n, ns)
}
, ConfigOption
{ key = "a_list"
, required = True
, parser = list integer
, action = \ns (s,n,_) -> (s, n, ns)
}
]
main :: IO ()
main = parseFromFile cp "./config.txt" >>= print