logo       

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

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 (Comment added) made by eivuokko
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.



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

>Comment By: Esa Ilari Vuokko (eivuokko)
Date: 2004-05-13 19:47

Message:
Logged In: YES
user_id=608034

It appears that I had an autopackage installed that had
-fglasgow-exts enabled. Sorry for the noise.


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

Comment By: Simon Marlow (simonmar)
Date: 2004-05-12 19:16

Message:
Logged In: YES
user_id=48280

It sounds like you have template haskell turned on
accidentally. Perhaps you have a .ghci file in your home
directory? (wherever $HOME is).

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

Comment By: Simon Peyton Jones (simonpj)
Date: 2004-05-12 16:09

Message:
Logged In: YES
user_id=50165

I can't reproduce this. It works fine for me. (Unless I say -
fth, of course.)

sh-2.04$ 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)]
1
Prelude>
Prelude> :set -fth
Prelude> fst$head [(1,2)]

<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)]
Prelude>

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

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