Comments (5)
This ticket is tracking the GHC issue -- https://ghc.haskell.org/trac/ghc/ticket/10961?cversion=0&cnum_hist=1
I just unsafePerfromIO on the wrapper and have never encountered meaningful problems. The part which is used by the parser is not initialised in IO and so there shouldn't be any problems.
from ghc-exactprint.
The differences i observed between parseWith [..] GHC.parseModule ..
and parseModule
are:
parseWith
does not respectLANGUAGE
pragmas.parseWith
does not return annotations, i guess because i did not setGHC.Opt_KeepRawTokenStream
, which happens as part of the unexposedinitDynFlags
when usingparseModule
.
I'll make a PR in a sec.
from ghc-exactprint.
If you are parsing a whole module, have you tried using parseModule
?
from ghc-exactprint.
Yes. However, parseModule
is fundamentally impure, reading the source from some file. This difference threads through the internal functions, too.
from ghc-exactprint.
#39 seems to be "mostly pure", although i have not looked into exactly what side-effects are done by e.g. parseDynamicFilePragma
.
from ghc-exactprint.
Related Issues (20)
- 1.3.0 is not buildable with ghc <9.2 HOT 1
- Hackage revisions with upper bounds on ghc package HOT 1
- Build failure with GHC 9.4.1 HOT 7
- For exactprint 1.5.0 / ghc-9.2.5, `makeDeltaAst'` seems to just break things
- balanceCommentsList makes a mess of relative positions
- Missing match for HsType: HsDocTy HOT 1
- Missing match for IE HOT 1
- ghc-9.8.1 build failure HOT 4
- No instance for ‘MonadTrans TransformT’ HOT 3
- Usage examples? HOT 14
- ParseResult is a different type after 8.10 HOT 1
- parseModuleFromString seems to use unhelpful dflags HOT 1
- exactPrinted comments seem to gain additional carriage returns on Windows
- addAnnotationsForPretty breaks layout HOT 5
- Parse/Print roundtrip loses shebang unless file path is in the form of "dir/file.hs"
- Migrate to ghc-lib HOT 2
- Release 0.6.3.3 HOT 3
- Using `ghc-paths` makes downstream executables non portable HOT 4
- Can DeltaPos of the first pattern not depend on the position of "case"? HOT 2
- Support GHC 9.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghc-exactprint.