Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ghc reports errors in wrong lines for functions employing hsp
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Facundo Domínguez  
View profile  
 More options Dec 5 2011, 2:39 pm
From: Facundo Domínguez <facundoming...@gmail.com>
Date: Mon, 5 Dec 2011 17:39:12 -0200
Local: Mon, Dec 5 2011 2:39 pm
Subject: ghc reports errors in wrong lines for functions employing hsp
Hi List,
 I'd like to file this bug. Please, let me know if there is a better
place for that.

ghc reports an error in line 12 of the following program. The error is
pasted below.

The expected behavior is to have ghc report the error in line 8, as it
would normally happen if the error occurred in a file which is not
preprocessed.

> {-# OPTIONS_GHC -F -pgmFtrhsx #-}

> import HSP

> main = (putStrLn =<<)$ fmap (renderAsHTML . snd)$ evalHSP Nothing$
>    <html>
>    <body>
>      <% "hello" == 2 %>
>    </body>
>    </html>

test.hs:12:32:
   Couldn't match type `XML' with `Bool'
   In the first argument of `asChild', namely
     `((asChild ("hello" == 2)))'
   In the expression: asChild ((asChild ("hello" == 2)))
   In the third argument of `genElement', namely
     `[asChild ((asChild ("hello" == 2)))]'

Regards!
Facundo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options Dec 6 2011, 1:46 pm
From: Jeremy Shaw <jashaw...@gmail.com>
Date: Tue, 6 Dec 2011 12:46:52 -0600
Local: Tues, Dec 6 2011 1:46 pm
Subject: Re: ghc reports errors in wrong lines for functions employing hsp

If we run trhsx on this document we see:

$ trhsx test.hs
{-# LINE 1 "test.hs" #-}
{-# OPTIONS_GHC -F -pgmFtrhsx  #-}
module Main (main) where
{-# LINE 2 "test.hs" #-}
import HSP
{-# LINE 3 "test.hs" #-}
main
  = (putStrLn =<<) $
      fmap (renderAsHTML . snd) $
        evalHSP Nothing $
          (genElement (Nothing, "html") []
             [asChild
                ((genElement (Nothing, "body") []
                    [asChild ((asChild ("hello" == 2)))]))])

So, it looks like the LINE pragmas that trhsx inserts are correct. But that
it does not insert enough of them ?

- jeremy

2011/12/5 Facundo Domínguez <facundoming...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Niklas Broberg  
View profile  
 More options Dec 6 2011, 3:04 pm
From: Niklas Broberg <niklas.brob...@gmail.com>
Date: Tue, 6 Dec 2011 21:04:20 +0100
Local: Tues, Dec 6 2011 3:04 pm
Subject: Re: ghc reports errors in wrong lines for functions employing hsp

Thanks for the report Facundo, and thanks for digging in to the matter
Jeremy. It's clear that haskell-src-exts doesn't insert enough LINE
pragmas, though I'm not sure if it can ever be perfect. I'll look into it
though, surely I can do better than the current situation.

But in the longer run, the plan is to switch trhsx over to the
exact-printer rather than the pretty-printer. That move should give far
more precision.

And in the even longer run, the plan is to complete the type checker that
would allows us to type check directly on the hsx code, rather than waiting
for GHC to do it on the post-processed code.

Anyone feel like hiring me for a month or two, so I can take the time off
from my current job and do some hsp-related work for a while? ;-)

Cheers,

/Niklas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »