diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2018-01-14 13:08:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-14 13:08:39 +0100 |
commit | b86318b510ef59606c5b7c882cad33af52ce257c (patch) | |
tree | 4978b8c3d0df4d388e44fa12460474f0f0c148b7 | |
parent | a0bf64b83dd218d1ea29823749dcfa8a6ee959a9 (diff) | |
parent | 9e20219a97353fbb6ca615851c8cdbea4b00f29d (diff) |
Merge pull request #4 from deepfire/master
Fix GHC 8.4 compat
-rw-r--r-- | lambdacube-ir.haskell/lambdacube-ir.cabal | 12 | ||||
-rw-r--r-- | lambdacube-ir.haskell/src/LambdaCube/PipelineSchemaUtil.hs | 8 |
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 #-} |
2 | module LambdaCube.PipelineSchemaUtil where | 2 | module LambdaCube.PipelineSchemaUtil where |
3 | 3 | ||
4 | import Control.Monad.Writer | 4 | import Control.Monad.Writer |
@@ -16,5 +16,11 @@ unionObjectArraySchema (ObjectArraySchema a1 b1) (ObjectArraySchema a2 b2) = | |||
16 | 16 | ||
17 | instance Monoid PipelineSchema where | 17 | instance 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 | ||
23 | instance 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 | ||