Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
cb342e53
Commit
cb342e53
authored
Jun 15, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #255 from bgamari/ghc7.8
GHC 7.8: Fix sandbox support and some debugging conveniences
parents
0e6dc7e5
bb5fa60a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
build-parser.sh
ghc-parser/build-parser.sh
+1
-1
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+10
-10
Util.hs
src/IHaskell/Eval/Util.hs
+13
-3
No files found.
ghc-parser/build-parser.sh
View file @
cb342e53
#!/bin/sh -e
#!/bin/
ba
sh -e
# Called from Setup.hs.
function
make_parser
{
...
...
src/IHaskell/Eval/Evaluate.hs
View file @
cb342e53
...
...
@@ -77,9 +77,14 @@ import Data.Version (versionBranch)
data
ErrorOccurred
=
Success
|
Failure
deriving
(
Show
,
Eq
)
-- | Enable debugging output
debug
::
Bool
debug
=
False
-- | Set GHC's verbosity for debugging
ghcVerbosity
::
Maybe
Int
ghcVerbosity
=
Nothing
-- Just 5
ignoreTypePrefixes
::
[
String
]
ignoreTypePrefixes
=
[
"GHC.Types"
,
"GHC.Base"
,
"GHC.Show"
,
"System.IO"
,
"GHC.Float"
,
":Interactive"
,
"GHC.Num"
,
"GHC.IO"
,
...
...
@@ -119,18 +124,13 @@ globalImports =
-- is handled specially, which cannot be done in a testing environment.
interpret
::
Bool
->
Interpreter
a
->
IO
a
interpret
allowedStdin
action
=
runGhc
(
Just
libdir
)
$
do
initGhci
-- If we're in a sandbox, add the relevant package database
dflags
<-
getSessionDynFlags
sandboxPackages
<-
liftIO
getSandboxPackageConf
let
pkgConfs
=
case
sandboxPackages
of
Nothing
->
extraPkgConfs
dflags
Just
path
->
let
pkg
=
PkgConfFile
path
in
(
pkg
:
)
.
extraPkgConfs
dflags
void
$
setSessionDynFlags
$
dflags
{
extraPkgConfs
=
pkgConfs
}
initGhci
sandboxPackages
case
ghcVerbosity
of
Just
verb
->
do
dflags
<-
getSessionDynFlags
void
$
setSessionDynFlags
$
dflags
{
verbosity
=
verb
}
Nothing
->
return
()
initializeImports
...
...
src/IHaskell/Eval/Util.hs
View file @
cb342e53
...
...
@@ -131,18 +131,28 @@ doc sdoc = do
-- @NoMonomorphismRestriction@), sets the target to interpreted, link in
-- memory, sets a reasonable output width, and potentially a few other
-- things. It should be invoked before other functions from this module.
initGhci
::
GhcMonad
m
=>
m
()
initGhci
=
do
--
-- We also require that the sandbox PackageConf (if any) is passed here
-- as setSessionDynFlags will read the package database the first time
-- (and only the first time) it is called.
initGhci
::
GhcMonad
m
=>
Maybe
String
->
m
()
initGhci
sandboxPackages
=
do
-- Initialize dyn flags.
-- Start with -XExtendedDefaultRules and -XNoMonomorphismRestriction.
originalFlags
<-
getSessionDynFlags
let
flag
=
flip
xopt_set
unflag
=
flip
xopt_unset
dflags
=
flag
Opt_ExtendedDefaultRules
.
unflag
Opt_MonomorphismRestriction
$
originalFlags
pkgConfs
=
case
sandboxPackages
of
Nothing
->
extraPkgConfs
originalFlags
Just
path
->
let
pkg
=
PkgConfFile
path
in
(
pkg
:
)
.
extraPkgConfs
originalFlags
void
$
setSessionDynFlags
$
dflags
{
hscTarget
=
HscInterpreted
,
ghcLink
=
LinkInMemory
,
pprCols
=
300
}
pprCols
=
300
,
extraPkgConfs
=
pkgConfs
}
-- | Evaluate a single import statement.
-- If this import statement is importing a module which was previously
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment