Windows compiler assumes (wrongly) TH when using ($)
Hi!
With ghc 6.2.1 (from haskell.org) for Windows barfs on
code like (this is from ghci)
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version
6.2.1, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package base ... linking ... done.
Prelude> fst$head [(1,2),(3,4)]
<interactive>:1:
Couldn't match `Language.Haskell.THSyntax.ExpQ'
against `[a] -> a'
Expected type: Language.Haskell.THSyntax.ExpQ
Inferred type: [a] -> a
In the first argument of `fst', namely `$[splice]head'
In the definition of `it':
it = fst ($[splice]head) [(1, 2), (3, 4)]
Prelude>
Workaround: fst$ head (notice the space).
This problem is not related to library functions:
Prelude> let foo=(\x -> x) in foo$foo 1
<interactive>:1:
GHC stage restriction: `foo'
is used in a top-level splice, and must be
imported, not defined locally
In the first argument of `foo', namely `$[splice]foo'
In the definition of `it':
it = let foo = (\ x -> ...) in foo ($[splice]foo) 1
Prelude>
GHC (debian testing/unstable) in Linux doesn't seem to
have this problem.
Trac metadata
Trac field |
Value |
Version |
6.2.1 |
Type |
Bug |
TypeOfFailure |
OtherFailure |
Priority |
normal |
Resolution |
ResolvedRejected |
Component |
Compiler |
Test case |
|
Differential revisions |
|
BlockedBy |
|
Related |
|
Blocking |
|
CC |
|
Operating system |
|
Architecture |
|