Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 461
    • Merge requests 461
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #219
Closed
Open
Created May 12, 2004 by eivuokko@trac-eivuokko

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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking