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

  • SEARCH
  • Home
  • 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 8217117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:21:33+00:00 2026-06-07T12:21:33+00:00

I have a trivial Template Haskell program that prints the name of the current

  • 0

I have a trivial Template Haskell program that prints the name of the current module (Main, here):

{-# LANGUAGE TemplateHaskell #-}
module Main
( main
) where

import Language.Haskell.TH
import Language.Haskell.TH.Syntax

modName ∷ String
modName = $(fmap loc_module qLocation »= λmod → return (LitE (StringL mod) ))

main ∷ IO ()
main = putStrLn modName

When I compile this, I get the following Loading messages from ghc:

tsuraan@localhost ~/test/modname $ ghc --make Main
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Linking Main ...

Why does ghc load all these packages when Template Haskell is enabled? Whenever I build a program that uses Template Haskell, especially one that is built against a lot of packages, my compile warnings are overwhelmed with these superfluous “Loading” messages. It would be nice if I could stop the messages from being printed, or stop the (unnecessary?) module loading from happening at all.

  • 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-06-07T12:21:34+00:00Added an answer on June 7, 2026 at 12:21 pm

    Template Haskell runs at compile time, via a bytecode interpreter (GHCi). Any package dependencies that you have — at compile time — will be loaded dynamically into GHC — at compile time, so that you can execute your splices.

    One of your dependencies is the Template Haskell library itself, which in turn depends on most of the core things.

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

Sidebar

Related Questions

You'll have to forgive me for asking a somewhat trivial question here, but I'm
Probably a very trivial problem. I have an object that looks like this: @PersistenceCapable
I have some trivial markup that looks like the following: <li class=someclass> <=% t'model.attr'
I have a TT plugin that does the trivial unique ids: sub get_unique_uid_tt {
I am coding some program that among many other operations have one that from
I have a trivial secure socket server-client program. For the server certificates, I created
I have problem that seems to be rather trivial but I was not able
New to Django so sorry if this is trivial I have a base.html template
Assume I have a make rule: .PHONY:gen gen: auto.template generate-sources auto.template that creates a
I have the following snippet of code, that although entirely trivial, illustrates a pattern

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.