summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2018-01-14 13:08:39 +0100
committerGitHub <noreply@github.com>2018-01-14 13:08:39 +0100
commitb86318b510ef59606c5b7c882cad33af52ce257c (patch)
tree4978b8c3d0df4d388e44fa12460474f0f0c148b7
parenta0bf64b83dd218d1ea29823749dcfa8a6ee959a9 (diff)
parent9e20219a97353fbb6ca615851c8cdbea4b00f29d (diff)
Merge pull request #4 from deepfire/master
Fix GHC 8.4 compat
-rw-r--r--lambdacube-ir.haskell/lambdacube-ir.cabal12
-rw-r--r--lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs8
2 files changed, 13 insertions, 7 deletions
diff --git a/lambdacube-ir.haskell/lambdacube-ir.cabal b/lambdacube-ir.haskell/lambdacube-ir.cabal
index 021151d..fb05fb1 100644
--- a/lambdacube-ir.haskell/lambdacube-ir.cabal
+++ b/lambdacube-ir.haskell/lambdacube-ir.cabal
@@ -25,11 +25,11 @@ library
25 -- other-modules: 25 -- other-modules:
26 other-extensions: OverloadedStrings, RecordWildCards, DeriveFunctor 26 other-extensions: OverloadedStrings, RecordWildCards, DeriveFunctor
27 -- CAUTION: When the build-depends change, please bump the git submodule in lambdacube-docker repository 27 -- CAUTION: When the build-depends change, please bump the git submodule in lambdacube-docker repository
28 build-depends: base >=4.9 && <4.10, 28 build-depends: base >=4.9,
29 containers >=0.5 && <0.6, 29 containers >=0.5,
30 vector >=0.12 && <0.13, 30 vector >=0.12,
31 text >=1.2 && <1.3, 31 text >=1.2,
32 aeson >=1.1 && <1.2, 32 aeson >=1.1,
33 mtl >=2.2 && <2.3 33 mtl >=2.2
34 hs-source-dirs: src 34 hs-source-dirs: src
35 default-language: Haskell2010 35 default-language: Haskell2010
diff --git a/lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs b/lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs
index a5eac55..dc2c456 100644
--- a/lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs
+++ b/lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs
@@ -1,4 +1,4 @@
1{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-} 1{-# LANGUAGE CPP, FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-}
2module LambdaCube.PipelineSchemaUtil where 2module LambdaCube.PipelineSchemaUtil where
3 3
4import Control.Monad.Writer 4import Control.Monad.Writer
@@ -16,5 +16,11 @@ unionObjectArraySchema (ObjectArraySchema a1 b1) (ObjectArraySchema a2 b2) =
16 16
17instance Monoid PipelineSchema where 17instance Monoid PipelineSchema where
18 mempty = PipelineSchema mempty mempty 18 mempty = PipelineSchema mempty mempty
19#if !MIN_VERSION_base(4,11,0)
19 mappend (PipelineSchema a1 b1) (PipelineSchema a2 b2) = 20 mappend (PipelineSchema a1 b1) (PipelineSchema a2 b2) =
20 PipelineSchema (Map.unionWith unionObjectArraySchema a1 a2) (Map.unionWith (\a b -> if a == b then a else error $ "schema type mismatch " ++ show (a,b)) b1 b2) 21 PipelineSchema (Map.unionWith unionObjectArraySchema a1 a2) (Map.unionWith (\a b -> if a == b then a else error $ "schema type mismatch " ++ show (a,b)) b1 b2)
22#else
23instance Semigroup PipelineSchema where
24 (<>) (PipelineSchema a1 b1) (PipelineSchema a2 b2) =
25 PipelineSchema (Map.unionWith unionObjectArraySchema a1 a2) (Map.unionWith (\a b -> if a == b then a else error $ "schema type mismatch " ++ show (a,b)) b1 b2)
26#endif