Merge pull request #927 from erikd/topic/ghc-8.4-singletons

ihaskell-widgets: Make it compile with ghc 8.4
This commit is contained in:
Vaibhav Sagar 2018-09-01 12:04:59 -04:00 committed by GitHub
commit 50ff0ff7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 7 deletions

View File

@ -97,7 +97,7 @@ library
, ipython-kernel >= 0.6.1.2
, text >= 0.11
, unordered-containers -any
, vinyl >= 0.5
, vinyl >= 0.5 && < 0.9
, vector -any
, scientific -any
, unix -any

View File

@ -7,6 +7,7 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE EmptyCase #-}
module IHaskell.Display.Widgets.Singletons where
@ -16,7 +17,7 @@ import Data.Singletons.Prelude.Ord
-- Widget properties
singletons
[d|
data Field = ViewModule
| ViewName
| ModelModule

View File

@ -14,6 +14,7 @@
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE CPP #-}
-- | This module houses all the type-trickery needed to make widgets happen.
--
@ -79,7 +80,12 @@ import Data.Vinyl.Functor (Compose(..), Const(..))
import Data.Vinyl.Lens (rget, rput, type ())
import Data.Vinyl.TypeLevel (RecAll)
#if MIN_VERSION_singletons(2,4,0)
import Data.Singletons.Prelude.List
#else
import Data.Singletons.Prelude ((:++))
#endif
import Data.Singletons.TH
import GHC.IO.Exception
@ -92,6 +98,16 @@ import IHaskell.Display.Widgets.Singletons (Field, SField)
import qualified IHaskell.Display.Widgets.Singletons as S
import IHaskell.Display.Widgets.Common
#if MIN_VERSION_singletons(2,4,0)
-- Versions of the "singletons" package are tightly tied to the GHC version.
-- Singletons versions 2.3.* and earlier used the type level operator ':++'
-- for appending type level lists while 2.4.* and latter use the normal value
-- level list append operator '++'.
-- To maintain compatibility across GHC versions we keep using the ':++'
-- operator for now.
type (a :++ b) = a ++ b
#endif
-- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication.
type WidgetClass = '[S.ViewModule, S.ViewName, S.ModelModule, S.ModelName,
S.MsgThrottle, S.Version, S.DisplayHandler]

View File

@ -1,3 +1,5 @@
resolver: lts-12.8
flags: {}
packages:
- .
@ -5,18 +7,21 @@ packages:
- ./ghc-parser
- ./ihaskell-display/ihaskell-aeson
- ./ihaskell-display/ihaskell-blaze
# - ./ihaskell-display/ihaskell-charts
# - ./ihaskell-display/ihaskell-diagrams
- ./ihaskell-display/ihaskell-charts
- ./ihaskell-display/ihaskell-diagrams
- ./ihaskell-display/ihaskell-gnuplot
- ./ihaskell-display/ihaskell-hatex
- ./ihaskell-display/ihaskell-juicypixels
- ./ihaskell-display/ihaskell-magic
# - ./ihaskell-display/ihaskell-plot
- ./ihaskell-display/ihaskell-plot
- ./ihaskell-display/ihaskell-static-canvas
# - ./ihaskell-display/ihaskell-widgets
resolver: lts-12.8
- ./ihaskell-display/ihaskell-widgets
extra-deps:
- magic-1.1
- Chart-1.9
- Chart-cairo-1.9
- plot-0.2.3.9
ghc-options:
# Eventually we want "$locals": -Wall -Werror