Unverified Commit 50ff0ff7 authored by Vaibhav Sagar's avatar Vaibhav Sagar Committed by GitHub

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

ihaskell-widgets: Make it compile with ghc 8.4
parents 3d382e7b 14c4de5a
...@@ -97,7 +97,7 @@ library ...@@ -97,7 +97,7 @@ library
, ipython-kernel >= 0.6.1.2 , ipython-kernel >= 0.6.1.2
, text >= 0.11 , text >= 0.11
, unordered-containers -any , unordered-containers -any
, vinyl >= 0.5 , vinyl >= 0.5 && < 0.9
, vector -any , vector -any
, scientific -any , scientific -any
, unix -any , unix -any
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE EmptyCase #-}
module IHaskell.Display.Widgets.Singletons where module IHaskell.Display.Widgets.Singletons where
...@@ -16,7 +17,7 @@ import Data.Singletons.Prelude.Ord ...@@ -16,7 +17,7 @@ import Data.Singletons.Prelude.Ord
-- Widget properties -- Widget properties
singletons singletons
[d| [d|
data Field = ViewModule data Field = ViewModule
| ViewName | ViewName
| ModelModule | ModelModule
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE CPP #-}
-- | This module houses all the type-trickery needed to make widgets happen. -- | This module houses all the type-trickery needed to make widgets happen.
-- --
...@@ -79,7 +80,12 @@ import Data.Vinyl.Functor (Compose(..), Const(..)) ...@@ -79,7 +80,12 @@ import Data.Vinyl.Functor (Compose(..), Const(..))
import Data.Vinyl.Lens (rget, rput, type ()) import Data.Vinyl.Lens (rget, rput, type ())
import Data.Vinyl.TypeLevel (RecAll) import Data.Vinyl.TypeLevel (RecAll)
#if MIN_VERSION_singletons(2,4,0)
import Data.Singletons.Prelude.List
#else
import Data.Singletons.Prelude ((:++)) import Data.Singletons.Prelude ((:++))
#endif
import Data.Singletons.TH import Data.Singletons.TH
import GHC.IO.Exception import GHC.IO.Exception
...@@ -92,6 +98,16 @@ import IHaskell.Display.Widgets.Singletons (Field, SField) ...@@ -92,6 +98,16 @@ import IHaskell.Display.Widgets.Singletons (Field, SField)
import qualified IHaskell.Display.Widgets.Singletons as S import qualified IHaskell.Display.Widgets.Singletons as S
import IHaskell.Display.Widgets.Common 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. -- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication.
type WidgetClass = '[S.ViewModule, S.ViewName, S.ModelModule, S.ModelName, type WidgetClass = '[S.ViewModule, S.ViewName, S.ModelModule, S.ModelName,
S.MsgThrottle, S.Version, S.DisplayHandler] S.MsgThrottle, S.Version, S.DisplayHandler]
......
resolver: lts-12.8
flags: {} flags: {}
packages: packages:
- . - .
...@@ -5,18 +7,21 @@ packages: ...@@ -5,18 +7,21 @@ packages:
- ./ghc-parser - ./ghc-parser
- ./ihaskell-display/ihaskell-aeson - ./ihaskell-display/ihaskell-aeson
- ./ihaskell-display/ihaskell-blaze - ./ihaskell-display/ihaskell-blaze
# - ./ihaskell-display/ihaskell-charts - ./ihaskell-display/ihaskell-charts
# - ./ihaskell-display/ihaskell-diagrams - ./ihaskell-display/ihaskell-diagrams
- ./ihaskell-display/ihaskell-gnuplot - ./ihaskell-display/ihaskell-gnuplot
- ./ihaskell-display/ihaskell-hatex - ./ihaskell-display/ihaskell-hatex
- ./ihaskell-display/ihaskell-juicypixels - ./ihaskell-display/ihaskell-juicypixels
- ./ihaskell-display/ihaskell-magic - ./ihaskell-display/ihaskell-magic
# - ./ihaskell-display/ihaskell-plot - ./ihaskell-display/ihaskell-plot
- ./ihaskell-display/ihaskell-static-canvas - ./ihaskell-display/ihaskell-static-canvas
# - ./ihaskell-display/ihaskell-widgets - ./ihaskell-display/ihaskell-widgets
resolver: lts-12.8
extra-deps: extra-deps:
- magic-1.1 - magic-1.1
- Chart-1.9
- Chart-cairo-1.9
- plot-0.2.3.9
ghc-options: ghc-options:
# Eventually we want "$locals": -Wall -Werror # Eventually we want "$locals": -Wall -Werror
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment