QuasiQuotes troubles

Help
2012-01-15
2012-12-06
  • I have troubles with "non-dollar" quasi-quoting:

    {-# LANGUAGE QuasiQuotes #-}
    import Data.ByteString (ByteString)
    import Data.ByteString.UTF8 (fromString)
    import Text.InterpolatedString.Perl6 (q)
    viewCheck :: ByteString
    viewCheck = fromString [q| 
    function (doc) { 
        emit(null, doc);
    } |]
    

    And has error:

    Parse error: ;
    

    But it's valid code. It seems that without a dollar sign, eklipsfp believes everything inside

    [|  |]
    

    is haskell code.

    With dollar sign all good, but I have warning then build:

    Deprecated syntax: quasiquotes no longer need a dollar sign: $q
    
     
  • JP Moresmau
    JP Moresmau
    2012-01-15

    We use haskell-src-exts to parse for the outline, and it's a known limitation of that package that it doesn't handle yet the new quasi quote syntax. I have had the issue myself and notified the maintainer, who said that it was going to be fixed in the next release. It works if you build haskell-src-exts from source (there's a darcs repo at http://code.haskell.org/haskell-src-exts/). You can of course ping the maintainer to ask him when he's planning to release the new version…

     
  • Ohh.  code.haskell.org == no communication. Thanks for explamation. I find another solution.