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
049796bc
Commit
049796bc
authored
Aug 28, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove more CPP
parent
000ea0fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
38 deletions
+3
-38
Charts.hs
ihaskell-display/ihaskell-charts/IHaskell/Display/Charts.hs
+1
-8
Util.hs
src/IHaskell/Eval/Util.hs
+0
-6
IPython.hs
src/IHaskell/IPython.hs
+0
-11
Completion.hs
src/tests/IHaskell/Test/Completion.hs
+2
-7
Parser.hs
src/tests/IHaskell/Test/Parser.hs
+0
-6
No files found.
ihaskell-display/ihaskell-charts/IHaskell/Display/Charts.hs
View file @
049796bc
{-# LANGUAGE CPP #-}
module
IHaskell.Display.Charts
()
where
import
System.Directory
...
...
@@ -34,7 +32,7 @@ chartData renderable format = do
-- Write the PNG image.
let
filename
=
".ihaskell-chart.png"
opts
=
def
{
_fo_format
=
format
,
_fo_size
=
(
width
,
height
)
}
mk
File
opts
filename
renderable
renderableTo
File
opts
filename
renderable
-- Convert to base64.
imgData
<-
Char
.
readFile
filename
...
...
@@ -42,8 +40,3 @@ chartData renderable format = do
case
format
of
PNG
->
png
width
height
$
base64
imgData
SVG
->
svg
$
Char
.
unpack
imgData
#
if
MIN_VERSION_Chart_cairo
(
1
,
3
,
0
)
mkFile
opts
filename
renderable
=
renderableToFile
opts
filename
renderable
#
else
mkFile
opts
filename
renderable
=
renderableToFile
opts
renderable
filename
#
endif
src/IHaskell/Eval/Util.hs
View file @
049796bc
...
...
@@ -63,11 +63,9 @@ import StringUtils (replace)
import
CmdLineParser
(
warnMsg
)
#
endif
#
if
MIN_VERSION_ghc
(
8
,
0
,
1
)
import
GHC.LanguageExtensions
type
ExtensionFlag
=
Extension
#
endif
-- | A extension flag that can be set or unset.
data
ExtFlag
=
SetFlag
ExtensionFlag
...
...
@@ -265,11 +263,7 @@ initGhci sandboxPackages = do
originalFlags
<-
getSessionDynFlags
let
flag
=
flip
xopt_set
unflag
=
flip
xopt_unset
#
if
MIN_VERSION_ghc
(
8
,
0
,
0
)
dflags
=
flag
ExtendedDefaultRules
.
unflag
MonomorphismRestriction
$
originalFlags
#
else
dflags
=
flag
Opt_ExtendedDefaultRules
.
unflag
Opt_MonomorphismRestriction
$
originalFlags
#
endif
#
if
MIN_VERSION_ghc
(
8
,
2
,
0
)
pkgFlags
=
case
sandboxPackages
of
...
...
src/IHaskell/IPython.hs
View file @
049796bc
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-}
{-# LANGUAGE CPP #-}
-- | Description : Shell scripting wrapper using @Shelly@ for the @notebook@, and
-- @console@ commands.
...
...
@@ -278,16 +277,6 @@ getIHaskellPath = do
Nothing
->
error
"ihaskell not on $PATH and not referenced relative to directory."
Just
path
->
return
$
T
.
unpack
$
SH
.
toTextIgnore
path
else
liftIO
$
makeAbsolute
f
#
if
!
MIN_VERSION_directory
(
1
,
2
,
2
)
-- This is included in later versions of `directory`, but we cannot use later versions because GHC
-- library depends on a particular version of it.
makeAbsolute
::
FilePath
->
IO
FilePath
makeAbsolute
=
fmap
FP
.
normalise
.
absolutize
where
absolutize
path
-- avoid the call to `getCurrentDirectory` if we can
|
FP
.
isRelative
path
=
fmap
(
FP
.</>
path
)
getCurrentDirectory
|
otherwise
=
return
path
#
endif
getSandboxPackageConf
::
IO
(
Maybe
String
)
getSandboxPackageConf
=
SH
.
shelly
$
do
myPath
<-
getIHaskellPath
...
...
src/tests/IHaskell/Test/Completion.hs
View file @
049796bc
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-}
{-# LANGUAGE CPP #-}
module
IHaskell.Test.Completion
(
testCompletions
)
where
import
Prelude
...
...
@@ -23,12 +22,8 @@ import IHaskell.Eval.Completion (complete, CompletionType(..), complet
completionTarget
)
import
IHaskell.Test.Util
(
replace
,
shouldBeAmong
,
ghc
)
#
if
!
MIN_VERSION_base
(
4
,
8
,
0
)
import
Control.Applicative
((
<$>
))
#
endif
-- | @readCompletePrompt "xs*ys"@ return @(xs, i)@ where i is the location of
-- @'*'@ in the input string.
-- @'*'@ in the input string.
readCompletePrompt
::
String
->
(
String
,
Int
)
readCompletePrompt
string
=
case
elemIndex
'*'
string
of
...
...
@@ -197,7 +192,7 @@ inDirectory :: [Shelly.FilePath] -- ^ directories relative to temporary director
->
[
Shelly
.
FilePath
]
-- ^ files relative to temporary directory
->
(
Shelly
.
FilePath
->
Interpreter
a
)
->
IO
a
-- | Run an Interpreter action, but first make a temporary directory
-- | Run an Interpreter action, but first make a temporary directory
-- with some files and folder and cd to it.
inDirectory
dirs
files
action
=
shelly
$
withTmpDir
$
\
dirPath
->
do
cd
dirPath
...
...
src/tests/IHaskell/Test/Parser.hs
View file @
049796bc
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE CPP #-}
module
IHaskell.Test.Parser
(
testParser
)
where
import
Prelude
...
...
@@ -15,11 +14,6 @@ import IHaskell.Eval.Parser (parseString, getModuleName, unloc, layout
CodeBlock
(
..
),
DirectiveType
(
..
),
StringLoc
(
..
),
PragmaType
(
..
))
import
IHaskell.Eval.ParseShell
(
parseShell
)
#
if
!
MIN_VERSION_base
(
4
,
8
,
0
)
import
Control.Applicative
((
<$>
))
#
endif
parses
::
String
->
IO
[
CodeBlock
]
parses
str
=
map
unloc
<$>
ghc
(
parseString
str
)
...
...
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