Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7218521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:29:37+00:00 2026-05-28T21:29:37+00:00

I have a dummy module in my project, whose sole purpose is to hold

  • 0

I have a dummy module in my project, whose sole purpose is to hold Haddock documentation for the rest of the library. In fact I don’t need to import anything in this module, but if I don’t import other modules, Haddock doesn’t hyperlink function names to their modules.

My module looks like this

{- |

Lots of Haddock text here... it references 'someFunction'.

-}
module TopLevelDoc () where

import Other.Module.With.SomeFunction

Now if I build the project, I get this warning:

    Warning: The import of `Other.Module.With.SomeFunction' is redundant
           except perhaps to import instances from `Other.Module.With.SomeFunction'
         To import instances alone, use: import Other.Module.With.SomeFunction()

If I remove imports or make them (), Haddock doesn’t hyperlink someFunction to its documentation. If I leave such imports as is, I get lots of false warnings, which I don’t like. And I don’t want to suppress this kind of warning for the entire project, it may be useful for any other module but this one.

Questions:

  1. How do I get hyperlinked Haddock output without such warnings when building?
  2. Is it possible to disable warnings on per-file basis? (like I can do it globally with ghc-options in .cabal)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T21:29:37+00:00Added an answer on May 28, 2026 at 9:29 pm

    To silence the unused import warning, you can put a pragma at the top of your file:

    {-# OPTIONS_GHC -fno-warn-unused-imports #-}
    

    You can link to to identifiers that aren’t in scope by explicitly qualifying them:

    It is also possible to refer to entities that are not in scope in the current module, by giving the full qualified name of the entity:

    -- | The identifier 'M.T' is not in scope

    If M.T is not otherwise in scope, then Haddock will simply emit a link pointing to the entity T exported from module M (without checking to see whether either M or M.T exist).

    — The Haddock User Guide

    However, this will probably make your documentation source quite ugly, and the module qualifications aren’t removed from the output, so I’d recommend turning off the warnings instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a dummy Python module ( fields.py ) with custom Django fields which
I have this dummy target: <mkdir dir=${project.stage}/release <war destfile=${project.stage}/release/sigma.war> ... ... </war> What I
I have a dummy class where I am testing arrays. I've noticed that when
I have a generic method with this (dummy) code (yes I'm aware IList has
Let's say I have the following content: Lorem Ipsum is simply dummy text of
Image Dummy = Image.FromFile(image.png); Dummy.Save(image.bmp, ImageFormat.Bmp); what the question says i have these using
I have a table with three fields, FirstName, LastName and Email. Here's some dummy
So, I have a file called 'dummy' which contains the string: There is 100%
I've encountered a strange behavior in __declspec(dllexport) in my project. I have a C++
I have an ASP.NET MVC 2 application. Web project contains a reference to SomeProject

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.