TTG: On GHC.Data.FastString
To keep following the TTG goal of a GHC-independent AST, we want to remove all imports of GHC.*
from the Language.Haskell.*
hierarchy. One of these imports is FastString
.
After some discussion below we've decided to move FastString
from the GHC.Data
module hierarchy to the "independent" Data
one.
This issue should be closed after FastString
lives in this independent space, and all Language.Haskell.*
imports of FastString
then import Data.FastString
rather than GHC.Data.FastString
Currently, FastString
from GHC.Data.FastString
is used multiple times in the client-independent AST living in Language.Haskell.Syntax
.
The occurrences are:
data HsExpr id
= ...
| HsOverLabel (XOverLabel p) FastString
...
| HsQuasiQuote -- See Note [Quasi-quote overview] in GHC.Tc.Gen.Splice
(XQuasiQuote id)
(IdP id) -- Splice point
(IdP id) -- Quoter
SrcSpan -- The span of the enclosed string
FastString -- The enclosed string
...
data HsLit id
= ...
| HsString (XHsString x) {- SourceText -} FastString
data OverLitVal
= ...
| HsIsString !SourceText !FastString -- ^ String-looking literals
data HsTyLit
= ...
| HsStrTy SourceText FastString
newtype ModuleName = ModuleName FastString
I am wondering about how I can get rid of FastString in Language.Haskell.Syntax, and so by raising this issue I mean to discuss ways to solve this, and get started on implementing said solution
Perhaps some strategy resembling IdP
...
Thank you, romes
CC: @Ericson2314