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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:53:14+00:00 2026-06-10T10:53:14+00:00

I have written a small utility to expand all TH splices in a Haskell

  • 0

I have written a small utility to expand all TH splices in a Haskell module, so that I can use the haskell module even where TH is unavailable. To accomplish this, I pass the -ddump-splices option to GHC while compiling the module and capture the resulting code, and then replace the TH declarations in the module with the captured code.

However, it looks like -ddump-splices does not always generate compilable code. Specifically, it seems to use braces for layout but without adding the semicolons in the correct places!

Here is an example from my test file –

case dispatch_a3Tg pieces0_a3Tf of {
    Just f_a3U6
      -> f_a3U6
           master0_a3T9
           sub0_a3Ta
           toMaster0_a3Tb
           app4040_a3Tc
           handler4050_a3Td
           method0_a3Te
    Nothing -> app4040_a3Tc }

Here it generated opening and closing braces but not the semicolon needed between the two case alternatives. This causes the following error at compile time –

GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( Test.hs, interpreted )

Test.hs:51:17: parse error on input `->'
Failed, modules loaded: none.
Prelude> 
  • 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-10T10:53:15+00:00Added an answer on June 10, 2026 at 10:53 am

    No, the splice dumps are often invalid code and it takes significant time to reduce these to something that not only compiles but is human understandable. This was a source of frustration when investigating aspects of TYB.

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

Sidebar

Related Questions

I have written a few small utility applications in Clojure that I compile into
I have four small single-form utility applications that I have written in Delphi (Win32),
I have a small utility that was originally written in VS2005. I need to
I have a small utility that I use to download an MP3 file from
I have a small utility app written in Visual Basic 6 that has been
I have written a small utility to collect system data and output it to
I've written up a small console utility. Throughout the application, I have used slf4j/log4j
i have a very small utilty app written in c# that works fine on
I have written a small chat app that uses mysql + php to facilitate
I have written a small app that puts my bluetooth in discoverable mode for

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.