logo       

[ ghc-Bugs-952398 ] Windows compiler assumes (wrongly) TH when using ($): msg#00030

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-952398 ] Windows compiler assumes (wrongly) TH when using ($)

Bugs item #952398, was opened at 2004-05-12 10:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=952398&group_id=8032

Category: Compiler
Group: 6.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Esa Ilari Vuokko (eivuokko)
Assigned to: Nobody/Anonymous (nobody)
Summary: Windows compiler assumes (wrongly) TH when using ($)

Initial Comment:
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.



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=952398&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise