mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 12:56:08 +00:00
Merge pull request #918 from erikd/topic/drop-old-ghc
Drop support for GHC < 8.0
This commit is contained in:
commit
50605e6ca7
@ -16,41 +16,19 @@ build-type: Simple
|
||||
-- extra-source-files:
|
||||
cabal-version: >=1.16
|
||||
|
||||
-- hs-source-dirs doesn't work well, doesn't take union, so include all src dirs specifically
|
||||
extra-source-files:
|
||||
HaskellParser76.y.pp
|
||||
HaskellParser782.y.pp
|
||||
HaskellParser783.y.pp
|
||||
src-7.10/Language/Haskell/GHC/HappyParser.hs
|
||||
src-7.8.2/Language/Haskell/GHC/HappyParser.hs
|
||||
src-7.8.3/Language/Haskell/GHC/HappyParser.hs
|
||||
src-7.6/Language/Haskell/GHC/HappyParser.hs
|
||||
|
||||
library
|
||||
build-tools: happy, cpphs
|
||||
exposed-modules: Language.Haskell.GHC.Parser,
|
||||
Language.Haskell.GHC.HappyParser
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
build-depends: base >=4.6 && < 5,
|
||||
ghc >=7.6 && <8.7
|
||||
build-depends: base >=4.9 && < 5,
|
||||
ghc >=8.0 && <8.7
|
||||
|
||||
if impl(ghc >= 7.6) && impl(ghc < 7.8)
|
||||
hs-source-dirs: generic-src src-7.6
|
||||
if impl(ghc >= 8.0) && impl(ghc < 8.4)
|
||||
hs-source-dirs: generic-src src-8.0
|
||||
else
|
||||
if impl(ghc >= 7.8) && impl(ghc < 7.8.3)
|
||||
hs-source-dirs: generic-src src-7.8.2
|
||||
else
|
||||
if impl(ghc < 7.10)
|
||||
hs-source-dirs: generic-src src-7.8.3
|
||||
else
|
||||
if impl(ghc < 8.0)
|
||||
hs-source-dirs: generic-src src-7.10
|
||||
else
|
||||
if impl(ghc >= 8.0) && impl(ghc < 8.4)
|
||||
hs-source-dirs: generic-src src-8.0
|
||||
else
|
||||
hs-source-dirs: generic-src src-8.4
|
||||
hs-source-dirs: generic-src src-8.4
|
||||
|
||||
|
||||
default-language: Haskell2010
|
||||
|
@ -1,42 +0,0 @@
|
||||
module Language.Haskell.GHC.HappyParser
|
||||
( fullStatement
|
||||
, fullImport
|
||||
, fullDeclaration
|
||||
, fullExpression
|
||||
, fullTypeSignature
|
||||
, fullModule
|
||||
) where
|
||||
|
||||
import Parser
|
||||
import SrcLoc
|
||||
|
||||
-- compiler/hsSyn
|
||||
import HsSyn
|
||||
|
||||
-- compiler/utils
|
||||
import OrdList
|
||||
|
||||
-- compiler/parser
|
||||
import RdrHsSyn
|
||||
import Lexer
|
||||
|
||||
-- compiler/basicTypes
|
||||
import RdrName
|
||||
|
||||
fullStatement :: P (Maybe (LStmt RdrName (LHsExpr RdrName)))
|
||||
fullStatement = parseStmt
|
||||
|
||||
fullImport :: P (LImportDecl RdrName)
|
||||
fullImport = parseImport
|
||||
|
||||
fullDeclaration :: P (OrdList (LHsDecl RdrName))
|
||||
fullDeclaration = parseDeclaration
|
||||
|
||||
fullExpression :: P (LHsExpr RdrName)
|
||||
fullExpression = parseExpression
|
||||
|
||||
fullTypeSignature :: P (Located (OrdList (LHsDecl RdrName)))
|
||||
fullTypeSignature = parseTypeSignature
|
||||
|
||||
fullModule :: P (Located (HsModule RdrName))
|
||||
fullModule = parseModule
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-aeson
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,7 +13,7 @@ version: 0.3.0.1
|
||||
synopsis: IHaskell display instances for Aeson
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -27,20 +27,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -48,21 +48,21 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Aeson
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
here,
|
||||
text,
|
||||
bytestring,
|
||||
aeson >= 0.7,
|
||||
aeson-pretty >= 0.7,
|
||||
ihaskell >= 0.5
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,10 +1,10 @@
|
||||
-- Initial ihaskell-display.cabal generated by cabal init. For further
|
||||
-- Initial ihaskell-display.cabal generated by cabal init. For further
|
||||
-- documentation, see http://haskell.org/cabal/users-guide/
|
||||
|
||||
-- The name of the package.
|
||||
name: ihaskell-blaze
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -16,7 +16,7 @@ version: 0.3.0.1
|
||||
synopsis: IHaskell display instances for blaze-html types
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -30,20 +30,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -52,18 +52,18 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Blaze
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
blaze-html >= 0.6,
|
||||
blaze-markup >= 0.5,
|
||||
ihaskell >= 0.5
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-charts
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,7 +13,7 @@ version: 0.3.0.1
|
||||
synopsis: IHaskell display instances for charts types
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -27,20 +27,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -49,21 +49,21 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Charts
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
bytestring,
|
||||
data-default-class,
|
||||
directory,
|
||||
Chart,
|
||||
Chart-cairo >=1.2,
|
||||
ihaskell >= 0.6.2
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-diagrams
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,7 +13,7 @@ version: 0.3.2.1
|
||||
synopsis: IHaskell display instances for diagram types
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -27,20 +27,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -49,13 +49,13 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Diagrams
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
other-modules: IHaskell.Display.Diagrams.Animation
|
||||
IHaskell.Display.Diagrams.ImgSize
|
||||
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
text,
|
||||
bytestring,
|
||||
directory,
|
||||
@ -69,7 +69,7 @@ library
|
||||
active >= 0.2
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-gnuplot
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,7 +13,7 @@ version: 0.1.0.1
|
||||
synopsis: IHaskell display instance for Gnuplot (from gnuplot package)
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -27,21 +27,21 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Doro Rose <dororose@hotmail.com>
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: Doro Rose <dororose@hotmail.com>,
|
||||
Andrew Gibiansky <andrew.gibiansky@gmail.com>
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -49,18 +49,18 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Gnuplot
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
bytestring,
|
||||
gnuplot >= 0.5.4,
|
||||
ihaskell >= 0.6.2
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: ihaskell-hatex
|
||||
version: 0.2.1.1
|
||||
synopsis: IHaskell display instances for hatex
|
||||
-- description:
|
||||
-- description:
|
||||
homepage: http://www.github.com/gibiansky/IHaskell
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
@ -14,9 +14,9 @@ cabal-version: >=1.16
|
||||
|
||||
library
|
||||
exposed-modules: IHaskell.Display.Hatex
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
text,
|
||||
HaTeX >= 3.9,
|
||||
ihaskell >= 0.5
|
||||
default-language: Haskell2010
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-juicypixels
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -14,10 +14,10 @@ synopsis: IHaskell - IHaskellDisplay instances of the image types of
|
||||
|
||||
-- A longer description of the package.
|
||||
description: IHaskellDisplay instances of the image types of the JuicyPixels package. They are displayed as .JPG images.
|
||||
DynamicImages and Images of types PixelRGBA16, PixelRGBA8, PixelRGB16, PixelRGB8,
|
||||
DynamicImages and Images of types PixelRGBA16, PixelRGBA8, PixelRGB16, PixelRGB8,
|
||||
PixelYA16, PixelYA8, Pixel16, Pixel8, PixelCMYK16, PixelCMYK8, PixelF, Pixel32
|
||||
are supported.
|
||||
The module IHaskell.Juicypixels re-exports the modules IHaskell.Display and Codec.Picture.
|
||||
are supported.
|
||||
The module IHaskell.Juicypixels re-exports the modules IHaskell.Display and Codec.Picture.
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -32,21 +32,21 @@ license-file: LICENSE
|
||||
author: Roland Senn,
|
||||
Will Yager
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: rsx@bluewin.ch,
|
||||
will.yager@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -55,19 +55,19 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Juicypixels
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
bytestring,
|
||||
directory,
|
||||
JuicyPixels >= 3.1.3,
|
||||
ihaskell >= 0.6.2
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,10 +1,10 @@
|
||||
-- Initial ihaskell-display.cabal generated by cabal init. For further
|
||||
-- Initial ihaskell-display.cabal generated by cabal init. For further
|
||||
-- documentation, see http://haskell.org/cabal/users-guide/
|
||||
|
||||
-- The name of the package.
|
||||
name: ihaskell-magic
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -16,7 +16,7 @@ version: 0.3.0.1
|
||||
synopsis: IHaskell display instances for bytestrings
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/IHaskell
|
||||
@ -30,20 +30,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Adam Vogt
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -52,12 +52,12 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Magic
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
magic >= 1.0.8,
|
||||
text,
|
||||
bytestring,
|
||||
@ -65,10 +65,10 @@ library
|
||||
base64-bytestring,
|
||||
ipython-kernel,
|
||||
ihaskell >= 0.5
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell-plot
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,7 +13,7 @@ version: 0.3.0.1
|
||||
synopsis: IHaskell display instance for Plot (from plot package)
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/ihaskell
|
||||
@ -27,21 +27,21 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Sumit Sahrawat <sumit.sahrawat.apm13@itbhu.ac.in>
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: Sumit Sahrawat <sumit.sahrawat.apm13@itbhu.ac.in>,
|
||||
Andrew Gibiansky <andrew.gibiansky@gmail.com>
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
@ -49,19 +49,19 @@ cabal-version: >=1.16
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.Plot
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
plot,
|
||||
bytestring,
|
||||
hmatrix >= 0.10,
|
||||
ihaskell >= 0.6.2
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- hs-source-dirs:
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
@ -1,10 +1,10 @@
|
||||
-- Initial ihaskell-static-canvas.cabal generated by cabal init. For
|
||||
-- Initial ihaskell-static-canvas.cabal generated by cabal init. For
|
||||
-- further documentation, see http://haskell.org/cabal/users-guide/
|
||||
|
||||
-- The name of the package.
|
||||
name: ihaskell-static-canvas
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -16,7 +16,7 @@ version: 0.1.0.0
|
||||
synopsis: IHaskell display for static-canvas
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/IHaskell
|
||||
@ -30,20 +30,20 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
-- category:
|
||||
-- category:
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
-- extra-source-files:
|
||||
-- extra-source-files:
|
||||
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.10
|
||||
@ -52,22 +52,22 @@ cabal-version: >=1.10
|
||||
library
|
||||
-- Modules exported by the library.
|
||||
exposed-modules: IHaskell.Display.StaticCanvas
|
||||
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
-- other-modules:
|
||||
|
||||
-- other-modules:
|
||||
|
||||
-- LANGUAGE extensions used by modules in this package.
|
||||
-- other-extensions:
|
||||
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7,
|
||||
build-depends: base >=4.9,
|
||||
ihaskell,
|
||||
static-canvas,
|
||||
text
|
||||
|
||||
|
||||
-- Directories containing source files.
|
||||
hs-source-dirs: src
|
||||
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
-- Initial ihaskell-widgets.cabal generated by cabal init. For
|
||||
-- Initial ihaskell-widgets.cabal generated by cabal init. For
|
||||
-- further documentation, see http://haskell.org/cabal/users-guide/
|
||||
|
||||
-- The name of the package.
|
||||
name: ihaskell-widgets
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -16,7 +16,7 @@ version: 0.2.3.2
|
||||
synopsis: IPython standard widgets for IHaskell.
|
||||
|
||||
-- A longer description of the package.
|
||||
-- description:
|
||||
-- description:
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://www.github.com/gibiansky/IHaskell
|
||||
@ -30,19 +30,19 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Sumit Sahrawat
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: Sumit Sahrawat <sumit.sahrawat.apm13@iitbhu.ac.in>,
|
||||
Andrew Gibiansky <andrew.gibiansky@gmail.com>
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
-- category:
|
||||
-- category:
|
||||
|
||||
build-type: Simple
|
||||
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- Extra files to be distributed with the package, such as examples or a
|
||||
-- README.
|
||||
extra-source-files: README.md, MsgSpec.md
|
||||
|
||||
@ -89,12 +89,10 @@ library
|
||||
IHaskell.Display.Widgets.Singletons
|
||||
|
||||
-- LANGUAGE extensions used by modules in this package.
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
-- singletons 2.* require ghc 7.10.2
|
||||
-- other-extensions:
|
||||
|
||||
build-depends: aeson >=0.7
|
||||
, base >=4.7 && <5
|
||||
, base >=4.9 && <5
|
||||
, containers >= 0.5
|
||||
, ipython-kernel >= 0.6.1.2
|
||||
, text >= 0.11
|
||||
@ -104,30 +102,13 @@ library
|
||||
, scientific -any
|
||||
, unix -any
|
||||
, ihaskell >= 0.6.4.1
|
||||
if impl(ghc >= 7.10.2)
|
||||
build-depends: singletons >= 0.9.0
|
||||
if impl(ghc == 7.10.1)
|
||||
build-depends: singletons >= 0.9.0 && <2.0
|
||||
, nats -any
|
||||
if impl(ghc < 7.10.1)
|
||||
build-depends: singletons >= 0.9.0 && <2.0
|
||||
, nats <1.1
|
||||
|
||||
|
||||
-- The singletons package version is locked to the compiler
|
||||
-- so let cabal choose the right one.
|
||||
, singletons -any
|
||||
|
||||
-- Directories containing source files.
|
||||
hs-source-dirs: src
|
||||
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: Haskell2010
|
||||
|
||||
-- Deal with small -fcontext-stack on ghc-7.8.
|
||||
-- Default values:
|
||||
-- ghc-7.6.* = 200
|
||||
-- ghc-7.8.* = 20 -- Too small for vinyl & singletons
|
||||
-- ghc-7.10.* = 100
|
||||
if impl(ghc == 7.8.*)
|
||||
ghc-options: -fcontext-stack=100
|
||||
|
||||
-- compile without optimizations not to run out of memory on travis
|
||||
if impl(ghc == 7.10.*)
|
||||
ghc-options: -O0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- The name of the package.
|
||||
name: ihaskell
|
||||
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- The package version. See the Haskell package versioning policy (PVP)
|
||||
-- for standards guiding when and how versions should be incremented.
|
||||
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
|
||||
-- PVP summary: +-+------- breaking API changes
|
||||
@ -13,8 +13,8 @@ version: 0.9.1.0
|
||||
synopsis: A Haskell backend kernel for the IPython project.
|
||||
|
||||
-- A longer description of the package.
|
||||
description: IHaskell is a Haskell backend kernel for the IPython project. This allows using Haskell via
|
||||
a console or notebook interface. Additional packages may be installed to provide richer data visualizations.
|
||||
description: IHaskell is a Haskell backend kernel for the IPython project. This allows using Haskell via
|
||||
a console or notebook interface. Additional packages may be installed to provide richer data visualizations.
|
||||
|
||||
-- URL for the project homepage or repository.
|
||||
homepage: http://github.com/gibiansky/IHaskell
|
||||
@ -28,12 +28,12 @@ license-file: LICENSE
|
||||
-- The package author(s).
|
||||
author: Andrew Gibiansky
|
||||
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- An email address to which users can send suggestions, bug reports, and
|
||||
-- patches.
|
||||
maintainer: andrew.gibiansky@gmail.com
|
||||
|
||||
-- A copyright notice.
|
||||
-- copyright:
|
||||
-- copyright:
|
||||
|
||||
category: Development
|
||||
|
||||
@ -42,7 +42,7 @@ build-type: Simple
|
||||
-- Constraint on the version of Cabal needed to build this package.
|
||||
cabal-version: >=1.16
|
||||
|
||||
data-files:
|
||||
data-files:
|
||||
html/kernel.js
|
||||
html/logo-64x64.svg
|
||||
|
||||
@ -117,7 +117,7 @@ library
|
||||
IHaskell.BrokenPackages
|
||||
IHaskell.CSS
|
||||
Paths_ihaskell
|
||||
other-modules:
|
||||
other-modules:
|
||||
IHaskellPrelude
|
||||
StringUtils
|
||||
|
||||
@ -125,19 +125,19 @@ executable ihaskell
|
||||
-- .hs or .lhs file containing the Main module.
|
||||
main-is: Main.hs
|
||||
hs-source-dirs: main
|
||||
other-modules:
|
||||
other-modules:
|
||||
IHaskellPrelude
|
||||
Paths_ihaskell
|
||||
ghc-options: -threaded -rtsopts
|
||||
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
default-language: Haskell2010
|
||||
build-depends:
|
||||
build-depends:
|
||||
ihaskell -any,
|
||||
base >=4.6 && < 4.13,
|
||||
base >=4.9 && < 4.13,
|
||||
text >=0.11,
|
||||
transformers -any,
|
||||
ghc >=7.6 || < 7.11,
|
||||
ghc >=8.0 && < 8.7,
|
||||
process >=1.1,
|
||||
aeson >=0.7,
|
||||
bytestring >=0.10,
|
||||
@ -147,9 +147,6 @@ executable ihaskell
|
||||
directory -any,
|
||||
ipython-kernel >=0.7
|
||||
|
||||
if flag(binPkgDb)
|
||||
build-depends: bin-package-db
|
||||
|
||||
Test-Suite hspec
|
||||
Type: exitcode-stdio-1.0
|
||||
Ghc-Options: -threaded
|
||||
|
@ -34,7 +34,7 @@ library
|
||||
other-extensions: OverloadedStrings
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
build-depends: base >=4.6 && <5,
|
||||
build-depends: base >=4.9 && <5,
|
||||
aeson ,
|
||||
bytestring ,
|
||||
cereal ,
|
||||
|
@ -7,12 +7,10 @@ module IHaskellPrelude (
|
||||
Data.Typeable.Typeable,
|
||||
Data.Typeable.cast,
|
||||
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
Data.Typeable.Proxy,
|
||||
|
||||
GHC.Exts.IsString,
|
||||
GHC.Exts.IsList,
|
||||
#endif
|
||||
|
||||
System.IO.hPutStrLn,
|
||||
System.IO.hPutStr,
|
||||
@ -53,7 +51,7 @@ module IHaskellPrelude (
|
||||
Data.IORef.modifyIORef',
|
||||
Data.IORef.newIORef,
|
||||
|
||||
|
||||
|
||||
|
||||
-- Miscellaneous names
|
||||
Data.Map.Map,
|
||||
@ -78,13 +76,7 @@ import GHC.Enum as X
|
||||
import GHC.Num as X
|
||||
import GHC.Real as X
|
||||
import GHC.Err as X hiding (absentErr)
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
import GHC.Base as X hiding (Any, mapM, foldr, sequence, many, (<|>), Module(..))
|
||||
#elif MIN_VERSION_ghc(7,10,0)
|
||||
import GHC.Base as X hiding (Any, mapM, foldr, sequence, many, (<|>))
|
||||
#else
|
||||
import GHC.Base as X hiding (Any)
|
||||
#endif
|
||||
import Data.List as X hiding (head, last, tail, init, transpose, subsequences, permutations,
|
||||
foldl, foldl1, maximum, minimum, scanl, scanl1, scanr, scanr1,
|
||||
span, break, mapAccumL, mapAccumR, dropWhileEnd, (!!),
|
||||
|
10
main/Main.hs
10
main/Main.hs
@ -22,9 +22,7 @@ import System.Process (readProcess, readProcessWithExitCode)
|
||||
import System.Exit (exitSuccess, ExitCode(ExitSuccess))
|
||||
import Control.Exception (try, SomeException)
|
||||
import System.Environment (getArgs)
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
import System.Environment (setEnv)
|
||||
#endif
|
||||
import System.Posix.Signals
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Text.Encoding as E
|
||||
@ -142,12 +140,11 @@ runKernel kernelOpts profileSrc = do
|
||||
dir <- getIHaskellDir
|
||||
Stdin.recordKernelProfile dir profile
|
||||
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
when useStack $ do
|
||||
-- Detect if we have stack
|
||||
runResult <- try $ readProcessWithExitCode "stack" [] ""
|
||||
let stack =
|
||||
case runResult :: Either SomeException (ExitCode, String, String) of
|
||||
let stack =
|
||||
case runResult :: Either SomeException (ExitCode, String, String) of
|
||||
Left _ -> False
|
||||
Right (exitCode, stackStdout, _) -> exitCode == ExitSuccess && "The Haskell Tool Stack" `isInfixOf` stackStdout
|
||||
|
||||
@ -160,7 +157,6 @@ runKernel kernelOpts profileSrc = do
|
||||
in case tailMay val of
|
||||
Nothing -> return ()
|
||||
Just val' -> setEnv var val'
|
||||
#endif
|
||||
|
||||
-- Serve on all sockets and ports defined in the profile.
|
||||
interface <- serveProfile profile debug
|
||||
@ -258,7 +254,7 @@ replyTo :: ZeroMQInterface -> Message -> MessageHeader -> KernelState -> Interpr
|
||||
replyTo interface KernelInfoRequest{} replyHeader state = do
|
||||
let send msg = liftIO $ writeChan (iopubChannel interface) msg
|
||||
|
||||
-- Notify the frontend that the Kernel is idle
|
||||
-- Notify the frontend that the Kernel is idle
|
||||
idleHeader <- liftIO $ dupHeader replyHeader StatusMessage
|
||||
send $ PublishStatus idleHeader Idle
|
||||
|
||||
|
@ -31,7 +31,7 @@ import System.Environment (getEnv)
|
||||
import GHC hiding (Qualified)
|
||||
#if MIN_VERSION_ghc(8,2,0)
|
||||
import GHC.PackageDb
|
||||
#elif MIN_VERSION_ghc(7,10,0)
|
||||
#else
|
||||
import GHC.PackageDb (ExposedModule(exposedName))
|
||||
#endif
|
||||
import DynFlags
|
||||
@ -63,16 +63,14 @@ data CompletionType = Empty
|
||||
| KernelOption String
|
||||
| Extension String
|
||||
deriving (Show, Eq)
|
||||
|
||||
#if MIN_VERSION_ghc(8,2,0)
|
||||
exposedName :: (a, b) -> a
|
||||
exposedName = fst
|
||||
#endif
|
||||
#if MIN_VERSION_ghc(7,10,0)
|
||||
extName (FlagSpec { flagSpecName = name }) = name
|
||||
#else
|
||||
extName (name, _, _) = name
|
||||
|
||||
exposedName = id
|
||||
#endif
|
||||
extName (FlagSpec { flagSpecName = name }) = name
|
||||
|
||||
complete :: String -> Int -> Interpreter (String, [String])
|
||||
complete code posOffset = do
|
||||
-- Get the line of code which is being completed and offset within that line
|
||||
@ -93,11 +91,7 @@ complete code posOffset = do
|
||||
|
||||
let Just db = pkgDatabase flags
|
||||
getNames = map (moduleNameString . exposedName) . exposedModules
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
moduleNames = nub $ concatMap getNames $ concatMap snd db
|
||||
#else
|
||||
moduleNames = nub $ concatMap getNames db
|
||||
#endif
|
||||
|
||||
let target = completionTarget line pos
|
||||
completion = completionType line pos target
|
||||
@ -127,17 +121,12 @@ complete code posOffset = do
|
||||
return $ filter (prefix `isPrefixOf`) moduleNames
|
||||
|
||||
DynFlag ext -> do
|
||||
-- Possibly leave out the fLangFlags? The -XUndecidableInstances vs. obsolete
|
||||
-- -fallow-undecidable-instances.
|
||||
-- Possibly leave out the fLangFlags?
|
||||
let kernelOptNames = concatMap getSetName kernelOpts
|
||||
otherNames = ["-package", "-Wall", "-w"]
|
||||
|
||||
fNames = map extName fFlags ++
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
map extName wWarningFlags ++
|
||||
#else
|
||||
map extName fWarningFlags ++
|
||||
#endif
|
||||
map extName fLangFlags
|
||||
fNoNames = map ("no" ++) fNames
|
||||
fAllNames = map ("-f" ++) (fNames ++ fNoNames)
|
||||
@ -269,7 +258,7 @@ completionTarget code cursor = expandCompletionPiece pieceToComplete
|
||||
pieceToComplete = map fst <$> find (elem cursor . map snd) pieces
|
||||
pieces = splitAlongCursor $ Split.split splitter $ zip code [1 ..]
|
||||
splitter = Split.defaultSplitter
|
||||
{
|
||||
{
|
||||
-- Split using only the characters, which are the first elements of the (char, index) tuple
|
||||
Split.delimiter = Split.Delimiter [uncurry isDelim]
|
||||
-- Condense multiple delimiters into one and then drop them.
|
||||
|
@ -65,11 +65,7 @@ import qualified Linker
|
||||
import TcType
|
||||
import Unify
|
||||
import InstEnv
|
||||
#if MIN_VERSION_ghc(7, 8, 0)
|
||||
import GhcMonad (liftIO, withSession)
|
||||
#else
|
||||
import GhcMonad (withSession)
|
||||
#endif
|
||||
import GHC hiding (Stmt, TypeSig)
|
||||
import Exception hiding (evaluate)
|
||||
import Outputable hiding ((<>))
|
||||
@ -126,12 +122,7 @@ write :: (MonadIO m, GhcMonad m) => KernelState -> String -> m ()
|
||||
write state x = when (kernelDebug state) $ liftIO $ hPutStrLn stderr $ "DEBUG: " ++ x
|
||||
|
||||
type Interpreter = Ghc
|
||||
#if MIN_VERSION_ghc(7, 8, 0)
|
||||
-- GHC 7.8 exports a MonadIO instance for Ghc
|
||||
#else
|
||||
instance MonadIO.MonadIO Interpreter where
|
||||
liftIO = MonadUtils.liftIO
|
||||
#endif
|
||||
|
||||
requiredGlobalImports :: [String]
|
||||
requiredGlobalImports =
|
||||
[ "import qualified Prelude as IHaskellPrelude"
|
||||
@ -194,23 +185,13 @@ packageIdString' dflags pkg_cfg =
|
||||
Just cfg -> let
|
||||
PackageName name = packageName cfg
|
||||
in unpackFS name
|
||||
#elif MIN_VERSION_ghc(8,0,0)
|
||||
fromMaybe "(unknown)" (unitIdPackageIdString dflags $ packageConfigId pkg_cfg)
|
||||
#elif MIN_VERSION_ghc(7,10,2)
|
||||
fromMaybe "(unknown)" (packageKeyPackageIdString dflags $ packageConfigId pkg_cfg)
|
||||
#elif MIN_VERSION_ghc(7,10,0)
|
||||
packageKeyPackageIdString dflags . packageConfigId
|
||||
#else
|
||||
packageIdString . packageConfigId
|
||||
fromMaybe "(unknown)" (unitIdPackageIdString dflags $ packageConfigId pkg_cfg)
|
||||
#endif
|
||||
|
||||
getPackageConfigs :: DynFlags -> [PackageConfig]
|
||||
getPackageConfigs dflags =
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
foldMap snd pkgDb
|
||||
#else
|
||||
pkgDb
|
||||
#endif
|
||||
where
|
||||
Just pkgDb = pkgDatabase dflags
|
||||
|
||||
@ -236,10 +217,6 @@ initializeImports = do
|
||||
iHaskellPkgName = initStr ++ intercalate "." (map show (versionBranch version))
|
||||
#endif
|
||||
|
||||
#if !MIN_VERSION_ghc(8,0,0)
|
||||
unitId = packageId
|
||||
#endif
|
||||
|
||||
dependsOnRight pkg = not $ null $ do
|
||||
pkg <- db
|
||||
depId <- depends pkg
|
||||
@ -449,11 +426,7 @@ flushWidgetMessages state evalMsgs widgetHandler = do
|
||||
|
||||
|
||||
getErrMsgDoc :: ErrUtils.ErrMsg -> SDoc
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
getErrMsgDoc = ErrUtils.pprLocErrMsg
|
||||
#else
|
||||
getErrMsgDoc msg = ErrUtils.errMsgShortString msg $$ ErrUtils.errMsgContext msg
|
||||
#endif
|
||||
|
||||
safely :: KernelState -> Interpreter EvalOut -> Interpreter EvalOut
|
||||
safely state = ghandle handler . ghandle sourceErrorHandler
|
||||
@ -1083,11 +1056,7 @@ doLoadModule name modName = do
|
||||
setSessionDynFlags $ flip gopt_set Opt_BuildDynamicToo
|
||||
flags
|
||||
{ hscTarget = objTarget flags
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
, log_action = \dflags sev srcspan ppr _style msg -> modifyIORef' errRef (showSDoc flags msg :)
|
||||
#else
|
||||
, log_action = \dflags sev srcspan ppr msg -> modifyIORef' errRef (showSDoc flags msg :)
|
||||
#endif
|
||||
}
|
||||
|
||||
-- Load the new target.
|
||||
@ -1138,11 +1107,9 @@ doLoadModule name modName = do
|
||||
initializeItVariable
|
||||
|
||||
return $ displayError $ "Failed to load module " ++ modName ++ ": " ++ show exception
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
|
||||
objTarget flags = defaultObjectTarget $ targetPlatform flags
|
||||
#else
|
||||
objTarget flags = defaultObjectTarget
|
||||
#endif
|
||||
|
||||
keepingItVariable :: Interpreter a -> Interpreter a
|
||||
keepingItVariable act = do
|
||||
-- Generate the it variable temp name
|
||||
@ -1217,7 +1184,6 @@ capturedEval output stmt = do
|
||||
-- Initialize evaluation context.
|
||||
results <- forM initStmts goStmt
|
||||
|
||||
#if __GLASGOW_HASKELL__ >= 800
|
||||
-- This works fine on GHC 8.0 and newer
|
||||
dyn <- dynCompileExpr readVariable
|
||||
pipe <- case fromDynamic dyn of
|
||||
@ -1226,26 +1192,7 @@ capturedEval output stmt = do
|
||||
handle <- fdToHandle fd
|
||||
hSetEncoding handle utf8
|
||||
return handle
|
||||
#else
|
||||
-- Get the pipe to read printed output from. This is effectively the source code of dynCompileExpr
|
||||
-- from GHC API's InteractiveEval. However, instead of using a `Dynamic` as an intermediary, it just
|
||||
-- directly reads the value. This is incredibly unsafe! However, for some reason the `getContext`
|
||||
-- and `setContext` required by dynCompileExpr (to import and clear Data.Dynamic) cause issues with
|
||||
-- data declarations being updated (e.g. it drops newer versions of data declarations for older ones
|
||||
-- for unknown reasons). First, compile down to an HValue.
|
||||
let pipeExpr = printf "let %s = %s" (var "pipe_var_") readVariable
|
||||
Just (_, hValues, _) <- withSession $ liftIO . flip hscStmt pipeExpr
|
||||
-- Then convert the HValue into an executable bit, and read the value.
|
||||
pipe <- liftIO $ do
|
||||
fds <- unsafeCoerce hValues
|
||||
fd <- case fds of
|
||||
fd : _ -> return fd
|
||||
[] -> fail "Failed to evaluate pipes"
|
||||
_ -> fail $ "Expected one fd, saw "++show (length fds)
|
||||
handle <- fdToHandle fd
|
||||
hSetEncoding handle utf8
|
||||
return handle
|
||||
#endif
|
||||
|
||||
-- Keep track of whether execution has completed.
|
||||
completed <- liftIO $ newMVar False
|
||||
finishedReading <- liftIO newEmptyMVar
|
||||
|
@ -91,11 +91,7 @@ extensionFlag ext =
|
||||
|
||||
-- Check if a FlagSpec matches "No<ExtensionName>". In that case, we disable the extension.
|
||||
flagMatchesNo ext fs = ext == "No" ++ flagSpecName fs
|
||||
#if !MIN_VERSION_ghc(7,10,0)
|
||||
flagSpecName (name, _, _) = name
|
||||
|
||||
flagSpecFlag (_, flag, _) = flag
|
||||
#endif
|
||||
-- | Pretty-print dynamic flags (taken from 'InteractiveUI' module of `ghc-bin`)
|
||||
pprDynFlags :: Bool -- ^ Whether to include flags which are on by default
|
||||
-> DynFlags
|
||||
@ -111,17 +107,10 @@ pprDynFlags show_all dflags =
|
||||
]
|
||||
where
|
||||
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
warningFlags = DynFlags.wWarningFlags
|
||||
#else
|
||||
warningFlags = DynFlags.fWarningFlags
|
||||
#endif
|
||||
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
opt = gopt
|
||||
#else
|
||||
opt = dopt
|
||||
#endif
|
||||
|
||||
setting test flag
|
||||
| quiet = O.empty :: O.SDoc
|
||||
| is_on = fstr name :: O.SDoc
|
||||
@ -131,7 +120,7 @@ pprDynFlags show_all dflags =
|
||||
f = flagSpecFlag flag
|
||||
is_on = test f dflags
|
||||
quiet = not show_all && test f default_dflags == is_on
|
||||
|
||||
|
||||
#if MIN_VERSION_ghc(8,6,0)
|
||||
default_dflags = defaultDynFlags (settings dflags) (llvmTargets dflags, llvmPasses dflags)
|
||||
#elif MIN_VERSION_ghc(8,4,0)
|
||||
@ -139,22 +128,19 @@ pprDynFlags show_all dflags =
|
||||
#else
|
||||
default_dflags = defaultDynFlags (settings dflags)
|
||||
#endif
|
||||
|
||||
|
||||
fstr, fnostr :: String -> O.SDoc
|
||||
fstr str = O.text "-f" O.<> O.text str
|
||||
|
||||
|
||||
fnostr str = O.text "-fno-" O.<> O.text str
|
||||
|
||||
|
||||
(ghciFlags, others) = partition (\f -> flagSpecFlag f `elem` flgs) DynFlags.fFlags
|
||||
|
||||
|
||||
flgs = concat [flgs1, flgs2, flgs3]
|
||||
|
||||
|
||||
flgs1 = [Opt_PrintExplicitForalls]
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
flgs2 = [Opt_PrintExplicitKinds]
|
||||
#else
|
||||
flgs2 = []
|
||||
#endif
|
||||
|
||||
flgs3 = [Opt_PrintBindResult, Opt_BreakOnException, Opt_BreakOnError, Opt_PrintEvldWithShow]
|
||||
|
||||
-- | Pretty-print the base language and active options (taken from `InteractiveUI` module of
|
||||
@ -386,7 +372,7 @@ evalDeclarations decl = do
|
||||
|
||||
cleanUpDuplicateInstances :: GhcMonad m => m ()
|
||||
cleanUpDuplicateInstances = modifySession $ \hscEnv ->
|
||||
let
|
||||
let
|
||||
-- Get all class instances
|
||||
ic = hsc_IC hscEnv
|
||||
(clsInsts, famInsts) = ic_instances ic
|
||||
@ -395,21 +381,11 @@ cleanUpDuplicateInstances = modifySession $ \hscEnv ->
|
||||
in hscEnv { hsc_IC = ic { ic_instances = (clsInsts', famInsts) } }
|
||||
where
|
||||
instEq :: ClsInst -> ClsInst -> Bool
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
-- Only support replacing instances on GHC 7.8 and up
|
||||
instEq c1 c2
|
||||
| ClsInst { is_tvs = tpl_tvs, is_tys = tpl_tys, is_cls = cls } <- c1,
|
||||
ClsInst { is_tys = tpl_tys', is_cls = cls' } <- c2
|
||||
= cls == cls' && isJust (tcMatchTys tpl_tys tpl_tys')
|
||||
#elif MIN_VERSION_ghc(7,8,0)
|
||||
instEq c1 c2
|
||||
| ClsInst { is_tvs = tpl_tvs, is_tys = tpl_tys, is_cls = cls } <- c1,
|
||||
ClsInst { is_tys = tpl_tys', is_cls = cls' } <- c2
|
||||
= let tpl_tv_set = mkVarSet tpl_tvs
|
||||
in cls == cls' && isJust (tcMatchTys tpl_tv_set tpl_tys tpl_tys')
|
||||
#else
|
||||
instEq _ _ = False
|
||||
#endif
|
||||
|
||||
|
||||
-- | Get the type of an expression and convert it to a string.
|
||||
@ -450,18 +426,12 @@ getDescription str = do
|
||||
|
||||
where
|
||||
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
getInfo' = getInfo False
|
||||
#else
|
||||
getInfo' = getInfo
|
||||
#endif
|
||||
|
||||
#if MIN_VERSION_ghc(8,4,0)
|
||||
getType (theType, _, _, _, _) = theType
|
||||
#elif MIN_VERSION_ghc(7,8,0)
|
||||
getType (theType, _, _, _) = theType
|
||||
#else
|
||||
getType (theType, _, _) = theType
|
||||
getType (theType, _, _, _) = theType
|
||||
#endif
|
||||
|
||||
#if MIN_VERSION_ghc(8,4,0)
|
||||
@ -470,16 +440,12 @@ getDescription str = do
|
||||
showFixity thing fixity O.$$
|
||||
O.vcat (map GHC.pprInstance classInstances) O.$$
|
||||
O.vcat (map GHC.pprFamInst famInstances)
|
||||
#elif MIN_VERSION_ghc(7,8,0)
|
||||
#else
|
||||
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)
|
||||
#else
|
||||
printInfo (thing, fixity, classInstances) =
|
||||
pprTyThingInContextLoc False thing O.$$ showFixity thing fixity O.$$
|
||||
O.vcat (map GHC.pprInstance classInstances)
|
||||
#endif
|
||||
showFixity thing fixity =
|
||||
if fixity == GHC.defaultFixity
|
||||
|
@ -8,12 +8,10 @@ module IHaskellPrelude (
|
||||
Data.Typeable.Typeable,
|
||||
Data.Typeable.cast,
|
||||
|
||||
#if MIN_VERSION_ghc(7,8,0)
|
||||
Data.Typeable.Proxy,
|
||||
|
||||
GHC.Exts.IsString,
|
||||
GHC.Exts.IsList,
|
||||
#endif
|
||||
|
||||
System.IO.hPutStrLn,
|
||||
System.IO.hPutStr,
|
||||
@ -54,7 +52,7 @@ module IHaskellPrelude (
|
||||
Data.IORef.modifyIORef',
|
||||
Data.IORef.newIORef,
|
||||
|
||||
|
||||
|
||||
|
||||
-- Miscellaneous names
|
||||
Data.Map.Map,
|
||||
@ -80,13 +78,7 @@ import GHC.Enum as X
|
||||
import GHC.Num as X
|
||||
import GHC.Real as X
|
||||
import GHC.Err as X hiding (absentErr)
|
||||
#if MIN_VERSION_ghc(8,0,0)
|
||||
import GHC.Base as X hiding (Any, mapM, foldr, sequence, many, (<|>), Module(..))
|
||||
#elif MIN_VERSION_ghc(7,10,0)
|
||||
import GHC.Base as X hiding (Any, mapM, foldr, sequence, many, (<|>))
|
||||
#else
|
||||
import GHC.Base as X hiding (Any)
|
||||
#endif
|
||||
import Data.List as X hiding (head, last, tail, init, transpose, subsequences, permutations,
|
||||
foldl, foldl1, maximum, minimum, scanl, scanl1, scanr, scanr1,
|
||||
span, break, mapAccumL, mapAccumR, dropWhileEnd, (!!),
|
||||
|
@ -89,14 +89,7 @@ pages string expected = evaluationComparing comparison string
|
||||
Nothing -> dropScriptTag $ tail str
|
||||
|
||||
fixQuotes :: String -> String
|
||||
#if MIN_VERSION_ghc(7, 8, 0)
|
||||
fixQuotes = id
|
||||
#else
|
||||
fixQuotes = map $ \char -> case char of
|
||||
'\8216' -> '`'
|
||||
'\8217' -> '\''
|
||||
c -> c
|
||||
#endif
|
||||
|
||||
|
||||
testEval :: Spec
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
module IHaskell.Test.Parser (testParser) where
|
||||
module IHaskell.Test.Parser (testParser) where
|
||||
|
||||
import Prelude
|
||||
|
||||
@ -234,10 +234,4 @@ testParseString = describe "Parser" $ do
|
||||
|]) >>= (`shouldBe` [Located 2 (Expression "first"), Located 4 (Expression "second")])
|
||||
where
|
||||
dataKindsError = ParseError (Loc 1 10) msg
|
||||
#if MIN_VERSION_ghc(7, 10, 0)
|
||||
msg = "Cannot parse data constructor in a data/newtype declaration: 3"
|
||||
#elif MIN_VERSION_ghc(7, 8, 0)
|
||||
msg = "Illegal literal in type (use DataKinds to enable): 3"
|
||||
#else
|
||||
msg = "Illegal literal in type (use -XDataKinds to enable): 3"
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user