
Hello, I'm trying to get Scion to work well with GHC7, and I found a small issue (I'm not saying it's GHC7 only, maybe it was there in GHC 6.12). I'm using 7.0.2 I have the following code, which is idiotic but proves the point: fun :: t -> [Char] -> [Char] fun _=reverse . map toUpper And the TypecheckedSource gives me something like (using the ghc-syb-utils package to dump it:) {Bag(Located (HsBind Var)): [ (L {src\Folder1\ForAll.hs:8:1-29} (AbsBinds [{Var: t}] [] [ ((,,,) [{Var: t}] {Var: Folder1.ForAll.fun} {Var: fun} (SpecPrags []))] ({abstract:TcEvBinds}) {Bag(Located (HsBind Var)): [ (L {src\Folder1\ForAll.hs:9:1-27} (FunBind (L {src\Folder1\ForAll.hs:9:1-3} {Var: fun}) (False) (MatchGroup Obviously my code starts at line 8 in that example. The issue occurs when the scion code wants to tell the user what (name+type) is a particular line/column in the source Now the scion code does something simple: to find something at a given point, it goes down the tree, and when it encounters a Located object, it checks the location spans around the point we're looking at. The issue here is that the AbsBinds has a SrcSpan that only covers the type signature, and not the rest of the code, hence (I think) we never go down the contents, and Scion cannot resolve anything when a user asks it to. If the type signature is not present, the problem doesn't occur: the AbsBinds location covers all the source code. If the type signature is present but without any type variable, there is no AbsBinds and no problem. Is that normal behavior, and hence should I code a work around in Scion? Thanks! -- JP Moresmau http://jpmoresmau.blogspot.com/

I don't think anyone has really looked at those SrcSpans before. I'm fixing... Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell- | users-bounces@haskell.org] On Behalf Of JP Moresmau | Sent: 18 March 2011 13:52 | To: glasgow-haskell-users@haskell.org | Subject: Issue with SrcSpan of AbsBinds | | Hello, I'm trying to get Scion to work well with GHC7, and I found a | small issue (I'm not saying it's GHC7 only, maybe it was there in GHC | 6.12). I'm using 7.0.2 | I have the following code, which is idiotic but proves the point: | | fun :: t -> [Char] -> [Char] | fun _=reverse . map toUpper | | And the TypecheckedSource gives me something like (using the | ghc-syb-utils package to dump it:) | | {Bag(Located (HsBind Var)): | [ | (L {src\Folder1\ForAll.hs:8:1-29} | (AbsBinds | [{Var: t}] | [] | [ | ((,,,) | [{Var: t}] {Var: Folder1.ForAll.fun} {Var: fun} | (SpecPrags | []))] | ({abstract:TcEvBinds}) {Bag(Located (HsBind Var)): | [ | (L {src\Folder1\ForAll.hs:9:1-27} | (FunBind | (L {src\Folder1\ForAll.hs:9:1-3} {Var: fun}) | (False) | (MatchGroup | | Obviously my code starts at line 8 in that example. | The issue occurs when the scion code wants to tell the user what | (name+type) is a particular line/column in the source | Now the scion code does something simple: to find something at a given | point, it goes down the tree, and when it encounters a Located object, | it checks the location spans around the point we're looking at. The | issue here is that the AbsBinds has a SrcSpan that only covers the | type signature, and not the rest of the code, hence (I think) we never | go down the contents, and Scion cannot resolve anything when a user | asks it to. | If the type signature is not present, the problem doesn't occur: the | AbsBinds location covers all the source code. | If the type signature is present but without any type variable, there | is no AbsBinds and no problem. | | Is that normal behavior, and hence should I code a work around in Scion? | | Thanks! | | -- | JP Moresmau | http://jpmoresmau.blogspot.com/ | | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (3)
-
Ian Lynagh
-
JP Moresmau
-
Simon Peyton-Jones