Skip to content

Commit a5d21db

Browse files
authored
Merge pull request #107 from RyanGlScott/master
Explicitly quantify the kind variable in `shape` and `lengthSList`
2 parents 3b78f05 + 31eaf71 commit a5d21db

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sop-core/src/Data/SOP/Sing.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{-# LANGUAGE PolyKinds, StandaloneDeriving #-}
2+
#if __GLASGOW_HASKELL__ < 806
3+
-- Before GHC 8.6, TypeInType was required to explicitly quantify kind variables.
4+
-- After GHC 8.6, this feature was incorporated into PolyKinds.
5+
{-# LANGUAGE TypeInType #-}
6+
#endif
27
-- | Singleton types corresponding to type-level data structures.
38
--
49
-- The implementation is similar, but subtly different to that of the
@@ -93,7 +98,7 @@ deriving instance Eq (Shape xs)
9398
deriving instance Ord (Shape xs)
9499

95100
-- | The shape of a type-level list.
96-
shape :: forall (xs :: [k]). SListI xs => Shape xs
101+
shape :: forall k (xs :: [k]). SListI xs => Shape xs
97102
shape = case sList :: SList xs of
98103
SNil -> ShapeNil
99104
SCons -> ShapeCons shape
@@ -102,7 +107,7 @@ shape = case sList :: SList xs of
102107
--
103108
-- @since 0.2
104109
--
105-
lengthSList :: forall (xs :: [k]) proxy. SListI xs => proxy xs -> Int
110+
lengthSList :: forall k (xs :: [k]) proxy. SListI xs => proxy xs -> Int
106111
lengthSList _ = lengthShape (shape :: Shape xs)
107112
where
108113
lengthShape :: forall xs'. Shape xs' -> Int

0 commit comments

Comments
 (0)