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 9134193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:37:01+00:00 2026-06-17T08:37:01+00:00

Why Template Haskell ignores standalone deriving declaration in quotation? {-# LANGUAGE TemplateHaskell, StandaloneDeriving #-}

  • 0

Why Template Haskell ignores standalone deriving declaration in quotation?

{-# LANGUAGE TemplateHaskell, StandaloneDeriving #-}
data Test a = Test a
$([d| deriving instance Show a => Show (Test a); f x = x |])
ghci> :l Test.hs 
[1 of 1] Compiling Main             ( Test.hs, interpreted )
Ok, modules loaded: Main.
ghci> :t f
f :: t -> t
ghci> Test 1 :: Test Int

<interactive>:18:1:
    No instance for (Show (Test Int)) arising from a use of `print'
    Possible fix: add an instance declaration for (Show (Test Int))
    In a stmt of an interactive GHCi command: print it
  • 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-17T08:37:01+00:00Added an answer on June 17, 2026 at 8:37 am

    This used to be a shortcoming of the compiler, where the Template Haskell datatype for declarations is not even capable of storing a stand-alone deriving instance (see http://hackage.haskell.org/packages/archive/template-haskell/2.8.0.0/doc/html/Language-Haskell-TH-Syntax.html#t:Dec).

    Since 7.10, though, this bug has been fixed. (Thanks to @VladimirStill for pointing this out in a comment below.)

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

Sidebar

Related Questions

Based on a recent exchange , I've been convinced to use Template Haskell to
I just start learning Template Haskell, and stuck on simple problem with splicing. In
Unfortunately, many Template Haskell functions have absolutely no documentation at all. One such function
I suppose what I want is impossible without Template Haskell but I'll ask anyway.
Why does the following fail to compile (on GHC 7.4.2)? {-# LANGUAGE TemplateHaskell #-}
The documentation for Safe Haskell states: [...] Unfortunately Template Haskell can be used to
I have the following Template Haskell code in my module, which is part of
I'm creating a library to allow OCaml/Haskell-like algebraic data types and pattern matching. The
I was trying to translate the following Haskell code to C++: data List t
I have a trivial Template Haskell program that prints the name of the current

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.