Commit 14c4de5a authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

ihaskell-widgets: Make it compile with ghc 8.4

GHC 8.4 allows value level operators (in this case list append, '++') to
be used at the type level, so that the singletons package for GHC 8.4
uses this operator whereas previous versions of singletons defined a ':++'
operator for type level append.
parent dcd7d330
......@@ -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
......
......@@ -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
......
......@@ -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]
......
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
nix:
enable: false
......
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