File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed
message-index/messages/GHC-45906 Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE GHC2021 #-}
2
+
3
+ module SAKS where
4
+
5
+ import Data.Kind (Type )
6
+
7
+ type T :: Type
8
+ data T
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE Haskell2010 #-}
2
+
3
+ module SAKS where
4
+
5
+ import Data.Kind (Type )
6
+
7
+ type T :: Type
8
+ data T
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Illegal standalone kind signature
3
+ ---
4
+
5
+ Module fails to compile because it contains a standalone type
6
+ signature.
7
+
8
+ ## Error Message
9
+
10
+ ``` haskell
11
+ SAKS. hs: 7 : 1 : error : [GHC - 45906 ]
12
+ Illegal standalone kind signature
13
+ Suggested fix:
14
+ Perhaps you intended to use the ‘ StandaloneKindSignatures ’ extension (implied by ‘ UnliftedDatatypes ’ )
15
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Illegal standalone kind signature
3
+ summary : Program contains a standalone kind signature, but the active extensions do not allow it.
4
+ severity : error
5
+ introduced : 9.6.1
6
+ ---
7
+
8
+ [ Standalone kind signatures] can be used to specify a polymorphic
9
+ kind for a type, to overcome kind inference restrictions:
10
+
11
+ ``` haskell
12
+ type T :: (k -> Type ) -> k -> Type -- standalone kind signature
13
+ data T m a = MkT (m a ) (T Maybe (m a ))
14
+ ```
15
+
16
+ Without the standalone kind signature, GHC would infer the kind
17
+ `T :: (Type -> Type ) -> Type -> Type `.
18
+
19
+ Use of this feature requires the `StandaloneKindSignatures `
20
+ extension to be enabled. This extension is implied by
21
+ `UnliftedDatatypes `, and included in the `GHC2021 ` and `GHC2024 `
22
+ language editions.
23
+
24
+ [Standalone kind signatures]: https:// downloads. haskell. org/ ghc/ 9.12 . 1 / docs/ users_guide/ exts/ poly_kinds. html# standalone- kind- signatures- and - polymorphic- recursion
You can’t perform that action at this time.
0 commit comments