Skip to content

Commit 6eedd64

Browse files
authored
Merge pull request #148 from int-index/no-star
Don't use * as Type in the presence of TypeOperators
2 parents b660e3d + d0912c8 commit 6eedd64

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Data/Binary/Generic.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
{-# LANGUAGE Safe #-}
44
{-# OPTIONS_GHC -fno-warn-orphans #-}
55

6+
#if __GLASGOW_HASKELL__ >= 800
7+
#define HAS_DATA_KIND
8+
#endif
9+
610
-----------------------------------------------------------------------------
711
-- |
812
-- Module : Data.Binary.Generic
@@ -27,6 +31,9 @@ import Data.Binary.Put
2731
import Data.Bits
2832
import Data.Word
2933
import Data.Monoid ((<>))
34+
#ifdef HAS_DATA_KIND
35+
import Data.Kind
36+
#endif
3037
import GHC.Generics
3138
import Prelude -- Silence AMP warning.
3239

@@ -136,7 +143,11 @@ instance GBinaryPut a => GSumPut (C1 c a) where
136143
class SumSize f where
137144
sumSize :: Tagged f Word64
138145

139-
newtype Tagged (s :: * -> *) b = Tagged {unTagged :: b}
146+
#ifdef HAS_DATA_KIND
147+
newtype Tagged (s :: Type -> Type) b = Tagged {unTagged :: b}
148+
#else
149+
newtype Tagged (s :: * -> *) b = Tagged {unTagged :: b}
150+
#endif
140151

141152
instance (SumSize a, SumSize b) => SumSize (a :+: b) where
142153
sumSize = Tagged $ unTagged (sumSize :: Tagged a Word64) +

0 commit comments

Comments
 (0)