doxygen-parser: Parse Doxygen XML output into a typed Haskell AST

[ bsd3, development, documentation, library, parsing ] [ Propose Tags ] [ Report a vulnerability ]

A standalone library for invoking the doxygen binary on C/C++ headers and turning its XML output into a typed Haskell AST.

The library spawns doxygen on a set of header files, walks the resulting xml/ directory, and assembles a Doxygen.Parser.Doxygen value mapping each documented C entity to a structured Doxygen.Parser.Comment tree (with paragraphs, inline markup, parameter docs, group memberships, and cross-references).

See the Doxygen.Parser module for the public API and the project README for a quick-start example. The doxygen executable must be installed separately.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0
Change log CHANGELOG.md
Dependencies base (>=4.16 && <4.23), containers (>=0.6.5.1 && <0.9), directory (>=1.3.6.2 && <1.4), doxygen-parser, filepath (>=1.4 && <1.6), process (>=1.6 && <1.7), temporary (>=1.3 && <1.4), text (>=1.2 && <2.2), xml-conduit (>=1.9 && <1.11) [details]
Tested with ghc ==9.2.8 || ==9.4.8 || ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1
License BSD-3-Clause
Copyright 2024-2026 Well-Typed LLP and Anduril Industries Inc.
Author Well-Typed LLP
Maintainer info@well-typed.com
Uploaded by bolt12 at 2026-06-19T23:48:54Z
Category Development, Documentation, Parsing
Home page https://github.com/well-typed/doxygen-parser
Bug tracker https://github.com/well-typed/doxygen-parser/issues
Source repo head: git clone https://github.com/well-typed/doxygen-parser
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for doxygen-parser-0.1.0

[back to package description]

doxygen-parser: Parse Doxygen XML output into a typed Haskell AST

Build and test

doxygen-parser is a standalone Haskell library that invokes the doxygen binary on C/C++ header files and turns its XML output into a typed Haskell AST. It works on any C/C++ headers doxygen understands.

Requirements

The doxygen executable must be installed and on PATH (or the path must be supplied via the binary field of Config). Tested with doxygen 1.15.0; older versions usually work but the XML schema shifts subtly between releases.

Quick start

{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}

import Doxygen.Parser
import Data.List.NonEmpty (NonEmpty (..))

main :: IO ()
main = do
    Result{doxygen, warnings, doxygenVersion} <-
        parse defaultConfig ("myheader.h" :| [])
    putStrLn $ "doxygen version: " ++ show doxygenVersion
    mapM_ print warnings
    -- `doxygen` is opaque; query it with the lookup helpers:
    print $ lookupComment (KeyDecl "myFunc") doxygen

Result carries:

  • doxygen :: Doxygen: opaque map of DoxygenKey to comment trees, queried via lookupComment, lookupGroupMembership, and lookupGroupInfo.
  • warnings :: [Warning]: non-fatal degradations encountered while parsing (unknown elements, malformed refs, etc.).
  • doxygenVersion :: Text: the version of the doxygen binary that was invoked.

If the doxygen invocation itself fails, parse throws DoxygenException.

Public modules

Module Purpose
Doxygen.Parser Top-level public API. Start here.
Doxygen.Parser.Types The Comment / Block / Inline AST.
Doxygen.Parser.Warning Warning, Context, and Degradation types.

Stability

doxygen-parser follows the Haskell Package Versioning Policy. The Doxygen.Parser, Doxygen.Parser.Types, and Doxygen.Parser.Warning modules form the supported public API; breaking changes there bump the major version (A.B).

Used by

  • hs-bindgen: automatic Haskell FFI binding generation from C headers.

Contributors

Contributors are listed in the hs-bindgen README, which covers doxygen-parser along with the other supporting packages.

License

BSD-3-Clause. Copyright 2024-2026 Well-Typed LLP and Anduril Industries Inc. See LICENSE.