Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Template Haskell Typed Quotes #332

Closed
MHova opened this issue Apr 25, 2017 · 7 comments
Closed

Support Template Haskell Typed Quotes #332

MHova opened this issue Apr 25, 2017 · 7 comments

Comments

@MHova
Copy link

MHova commented Apr 25, 2017

This is probably a haskell-src-exts issue, but opening here anyway.

HLint is missing support for typed quotes, which has the [||...||] syntax. Currently HLint complains with a parse error.

MHova pushed a commit to MHova/haskell-canteven-http that referenced this issue Apr 25, 2017
In order to avoid having HLint parse the file at all. HLint currently does not support Template Haskell typed quotes: ndmitchell/hlint#332

Using this as a workaround: ndmitchell/hlint#117 (comment)
@ndmitchell
Copy link
Owner

Thanks for the info - almost certainly one to report to haskell-src-exts. Do you have a small file using typed quotes that works as a valid GHC program (e.g. runhaskell on it works) but fails to parse? That's what the HSE people tend to use for reproducing bugs.

@ndmitchell
Copy link
Owner

Did this get into a real GHC release? I can't find it in the user manual.

@MHova
Copy link
Author

MHova commented Sep 20, 2017

Are you talking about a fix in haskell-src-exts to support Typed Quotes? Or the existence of the Typed Quotes feature at all in GHC?

@ndmitchell
Copy link
Owner

The feature in GHC. I would usually go to the GHC manual, grab a small sample, and then create an HSE ticket containing that. However, in this instance, googling just took me to the wiki.

@MHova
Copy link
Author

MHova commented Sep 23, 2017

Sorry for the ridiculously delayed response on this, but here's a simple example showing the problem.

{-# LANGUAGE TemplateHaskell #-}

module Example where

import Language.Haskell.TH (TExp, Q)

example :: Q (TExp String)
example = [|| "whatever" ||]

This code snippet compiles, but hlint can't parse the code because:

Example.hs:8:13: Error: Parse error
Found:
    example :: Q (TExp String)
  > example = [|| "whatever" ||]

Using GHC 7.10.3 and hlint 2.0.9.

@ndmitchell
Copy link
Owner

Thanks, reported upstream at haskell-suite/haskell-src-exts#383.

@ndmitchell
Copy link
Owner

Confirmed works with HEAD that doesn't use HSE for parsing, so fixed in the next release.

TravisCardwell added a commit to ExtremaIS/ttc-haskell that referenced this issue Oct 5, 2020
HLint now supports typed expression quotations:
ndmitchell/hlint#332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants