Skip to content

ghci ignores LANGUAGE TemplateHaskell pragma

Save the following in Foo.hs

{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH.Syntax

$ ghci Foo.hs

Paste runQ [| (\x y -> compare x y == EQ) |] in ghci and press enter

Instead of getting a useful result, I get an error.

If I explicitly load TH on the command line, it does work.

Trac metadata
Trac field Value
Version 6.10.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information