Skip to content

yaitskov/haddock-use-refs

Repository files navigation

Haddock Use Refs

Haddock syntax supports hyper links to functions and types mentioned in comments (an identifier enclosed in single quotes). The link is inserted only if the name is fully qualified or imported in the module. Names referred only in module documentation pose a problem in form of compiler warning about unused imports.

This library helps with resolving these warnings authomatically without disabling all warnings of such type via a TH macro countDockRefs, which discovers all names in module documentation and generates a dummy type with an instance CountHaddockRefs using all names in the method.

{-# OPTIONS_GHC -Wall -Werror #-}
{-# LANGUAGE TemplateHaskell #-}
module Module where

import Haddock.UseRefs
import System.IO.Unsafe (unsafePerformIO)

countDocRefs

-- | 'unsafePerformIO' is not used by 'foo'.
foo :: Bool
foo = True

The library does not require any configuration.

About

Eliminate warnings for names referred in Haddock only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published