[GHC] #10583: Chaos in Lexeme.hs

GHC ghc-devs at haskell.org
Mon Jun 29 15:56:55 UTC 2015


#10583: Chaos in Lexeme.hs
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                   Owner:  goldfire
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:  10582
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by ezyang):

 Hello Richard,

 If you look at the types and the use-sites of the functions in question,
 you can get a clue what they are used for.

 * `isLexVarSym` operates on `FastString`s, and is primarily called by
 `isSymOcc` to do tests on `OccName`s. We variously need this to do things
 like check if a symbol name is valid (language check for `TypeOperators`)
 or make a decision about how to pretty-print a symbol, etc.

 * `okSymChar` operates on `String`s, and is used by the Template Haskell
 conversion interface to test that a TH-generated identifier looks like a
 valid symbol (if it is one.)

 * `notFollowedBySymbol` operates on the Alex state, and is used to make
 decisions in the Lexer. This one might be a bit more permissive than the
 others, since lexer errors are not nice for users but errors in the type-
 checker are much nicer.

 So probably `isLexVarSym` and `okSymChar` can and should be combined, but
 you'll have to do a goofy conversion from String to FastString to do it.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10583#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list