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
8cc1371e
Commit
8cc1371e
authored
Feb 07, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ihaskell: update
parent
2081c717
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
12 deletions
+60
-12
ihaskell.cabal
ihaskell.cabal
+2
-2
Main.hs
main/Main.hs
+4
-0
IpynbToLhs.hs
src/IHaskell/Convert/IpynbToLhs.hs
+0
-1
Parser.hs
src/IHaskell/Eval/Parser.hs
+5
-1
Util.hs
src/IHaskell/Eval/Util.hs
+38
-2
Flags.hs
src/IHaskell/Flags.hs
+1
-1
Types.hs
src/IHaskell/Types.hs
+8
-4
IHaskellPrelude.hs
src/IHaskellPrelude.hs
+2
-1
No files found.
ihaskell.cabal
View file @
8cc1371e
...
...
@@ -92,7 +92,7 @@ library
build-depends: bin-package-db
if impl(ghc >= 8.0)
build-depends: ghc-boot >=8.0 && <8.
3
build-depends: ghc-boot >=8.0 && <8.
5
exposed-modules: IHaskell.Display
IHaskell.Convert
...
...
@@ -134,7 +134,7 @@ executable ihaskell
default-language: Haskell2010
build-depends:
ihaskell -any,
base >=4.6 && < 4.1
1
,
base >=4.6 && < 4.1
2
,
text >=0.11,
transformers -any,
ghc >=7.6 || < 7.11,
...
...
main/Main.hs
View file @
8cc1371e
...
...
@@ -52,7 +52,11 @@ import qualified IHaskell.IPython.Stdin as Stdin
import
Paths_ihaskell
(
version
)
-- GHC API imports.
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
import
GHC
hiding
(
extensions
,
language
,
convert
)
#
else
import
GHC
hiding
(
extensions
,
language
)
#
endif
-- | Compute the GHC API version number using the dist/build/autogen/cabal_macros.h
ghcVersionInts
::
[
Int
]
...
...
src/IHaskell/Convert/IpynbToLhs.hs
View file @
8cc1371e
...
...
@@ -11,7 +11,6 @@ import qualified Data.ByteString.Lazy as LBS
import
qualified
Data.ByteString.Char8
as
CBS
import
Data.Aeson
(
decode
,
Object
,
Value
(
Array
,
Object
,
String
))
import
Data.Monoid
((
<>
),
Monoid
(
mempty
))
import
Data.Vector
(
Vector
)
import
Data.HashMap.Strict
(
lookup
)
...
...
src/IHaskell/Eval/Parser.hs
View file @
8cc1371e
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
{-# LANGUAGE
CPP,
NoImplicitPrelude, OverloadedStrings #-}
module
IHaskell.Eval.Parser
(
parseString
,
...
...
@@ -26,7 +26,11 @@ import Data.List (maximumBy, inits)
import
Prelude
(
head
,
tail
)
import
Control.Monad
(
msum
)
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
import
GHC
hiding
(
Located
,
Parsed
)
#
else
import
GHC
hiding
(
Located
)
#
endif
import
Language.Haskell.GHC.Parser
import
IHaskell.Eval.Util
...
...
src/IHaskell/Eval/Util.hs
View file @
8cc1371e
...
...
@@ -59,6 +59,10 @@ import Data.List (nubBy)
import
StringUtils
(
replace
)
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
import
CmdLineParser
(
warnMsg
)
#
endif
#
if
MIN_VERSION_ghc
(
8
,
0
,
1
)
import
GHC.LanguageExtensions
...
...
@@ -128,7 +132,11 @@ pprDynFlags show_all dflags =
is_on
=
test
f
dflags
quiet
=
not
show_all
&&
test
f
default_dflags
==
is_on
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
default_dflags
=
defaultDynFlags
(
settings
dflags
)
(
llvmTargets
dflags
)
#
else
default_dflags
=
defaultDynFlags
(
settings
dflags
)
#
endif
fstr
,
fnostr
::
String
->
O
.
SDoc
fstr
str
=
O
.
text
"-f"
O
.<>
O
.
text
str
...
...
@@ -176,7 +184,11 @@ pprLanguages show_all dflags =
quiet
=
not
show_all
&&
test
f
default_dflags
==
is_on
default_dflags
=
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
defaultDynFlags
(
settings
dflags
)
(
llvmTargets
dflags
)
`
lang_set
`
#
else
defaultDynFlags
(
settings
dflags
)
`
lang_set
`
#
endif
case
language
dflags
of
Nothing
->
Just
Haskell2010
other
->
other
...
...
@@ -211,7 +223,11 @@ setFlags ext = do
-- Create the parse errors.
let
noParseErrs
=
map
((
"Could not parse: "
++
)
.
unLoc
)
unrecognized
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
allWarns
=
map
(
unLoc
.
warnMsg
)
warnings
++
#
else
allWarns
=
map
unLoc
warnings
++
#
endif
[
"-package not supported yet"
|
packageFlags
flags
/=
packageFlags
flags'
]
warnErrs
=
map
(
"Warning: "
++
)
allWarns
return
$
noParseErrs
++
warnErrs
...
...
@@ -311,18 +327,30 @@ evalImport imports = do
where
-- Check whether an import is the same as another import (same module).
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
importOf
::
ImportDecl
GhcPs
->
InteractiveImport
->
Bool
#
else
importOf
::
ImportDecl
RdrName
->
InteractiveImport
->
Bool
#
endif
importOf
_
(
IIModule
_
)
=
False
importOf
imp
(
IIDecl
decl
)
=
((
==
)
`
on
`
(
unLoc
.
ideclName
))
decl
imp
&&
not
(
ideclQualified
decl
)
-- Check whether an import is an *implicit* import of something.
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
implicitImportOf
::
ImportDecl
GhcPs
->
InteractiveImport
->
Bool
#
else
implicitImportOf
::
ImportDecl
RdrName
->
InteractiveImport
->
Bool
#
endif
implicitImportOf
_
(
IIModule
_
)
=
False
implicitImportOf
imp
(
IIDecl
decl
)
=
ideclImplicit
decl
&&
imp
`
importOf
`
IIDecl
decl
-- Check whether an import is hidden.
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
isHiddenImport
::
ImportDecl
GhcPs
->
Bool
#
else
isHiddenImport
::
ImportDecl
RdrName
->
Bool
#
endif
isHiddenImport
imp
=
case
ideclHiding
imp
of
Just
(
True
,
_
)
->
True
...
...
@@ -420,13 +448,21 @@ getDescription str = do
getInfo'
=
getInfo
#
endif
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
getType
(
theType
,
_
,
_
,
_
,
_
)
=
theType
#
elif
MIN_VERSION_ghc
(
7
,
8
,
0
)
getType
(
theType
,
_
,
_
,
_
)
=
theType
#
else
getType
(
theType
,
_
,
_
)
=
theType
#
endif
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
printInfo
(
thing
,
fixity
,
classInstances
,
famInstances
,
_
)
=
pprTyThingInContextLoc
thing
O
.$$
showFixity
thing
fixity
O
.$$
O
.
vcat
(
map
GHC
.
pprInstance
classInstances
)
O
.$$
O
.
vcat
(
map
GHC
.
pprFamInst
famInstances
)
#
elif
MIN_VERSION_ghc
(
7
,
8
,
0
)
printInfo
(
thing
,
fixity
,
classInstances
,
famInstances
)
=
pprTyThingInContextLoc
thing
O
.$$
showFixity
thing
fixity
O
.$$
...
...
src/IHaskell/Flags.hs
View file @
8cc1371e
...
...
@@ -12,7 +12,7 @@ module IHaskell.Flags (
help
,
)
where
import
IHaskellPrelude
import
IHaskellPrelude
hiding
(
Arg
(
..
))
import
qualified
Data.Text
as
T
import
qualified
Data.Text.Lazy
as
LT
import
qualified
Data.ByteString
as
BS
...
...
src/IHaskell/Types.hs
View file @
8cc1371e
...
...
@@ -49,6 +49,7 @@ import Data.Aeson (Value, (.=), object)
import
Data.Aeson.Types
(
emptyObject
)
import
qualified
Data.ByteString.Char8
as
Char
import
Data.Function
(
on
)
import
Data.Semigroup
import
Data.Serialize
import
GHC.Generics
...
...
@@ -127,12 +128,15 @@ data Display = Display [DisplayData]
instance
Serialize
Display
instance
Semigroup
Display
where
ManyDisplay
a
<>
ManyDisplay
b
=
ManyDisplay
(
a
++
b
)
ManyDisplay
a
<>
b
=
ManyDisplay
(
a
++
[
b
])
a
<>
ManyDisplay
b
=
ManyDisplay
(
a
:
b
)
a
<>
b
=
ManyDisplay
[
a
,
b
]
instance
Monoid
Display
where
mempty
=
Display
[]
ManyDisplay
a
`
mappend
`
ManyDisplay
b
=
ManyDisplay
(
a
++
b
)
ManyDisplay
a
`
mappend
`
b
=
ManyDisplay
(
a
++
[
b
])
a
`
mappend
`
ManyDisplay
b
=
ManyDisplay
(
a
:
b
)
a
`
mappend
`
b
=
ManyDisplay
[
a
,
b
]
mappend
=
(
<>
)
-- | All state stored in the kernel between executions.
data
KernelState
=
...
...
src/IHaskellPrelude.hs
View file @
8cc1371e
...
...
@@ -67,7 +67,8 @@ module IHaskellPrelude (
import
Prelude
import
Data.Monoid
as
X
import
Data.Semigroup
as
X
import
Data.Monoid
as
X
hiding
((
<>
),
First
(
..
),
Last
(
..
))
import
Data.Tuple
as
X
import
Control.Monad
as
X
import
Data.Maybe
as
X
...
...
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