@hackage haddock-use-refs1.0.1

Eliminate warnings for names referred in Haddock only

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.