Skip to content

Commit f009f88

Browse files
fixup! document GHC-55666
1 parent 9fd8566 commit f009f88

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

message-index/messages/GHC-55666/example/after/Bang_on_unlifted_type.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# LANGUAGE MagicHash #-}
2+
13
module Bang_on_unlifted_type where
24

35
import GHC.Base (Int#)

message-index/messages/GHC-55666/example/before/Bang_on_unlifted_type.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# LANGUAGE MagicHash #-}
2+
13
module Bang_on_unlifted_type where
24

35
import GHC.Base (Int#)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
---
22
title: Bang (!) on unlifted type
33
---
4+
5+
```
6+
src/MyLib.hs:16:5: warning: [GHC-55666] [-Wredundant-strictness-flags]
7+
* Strictness flag has no effect on unlifted type `Int#'
8+
* In the definition of data constructor `MkT'
9+
In the data type declaration for `T'
10+
|
11+
| = MkT !Int#
12+
| ^^^^^^^
13+
```

message-index/messages/GHC-55666/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ introduced: GHC 9.6.1
77
---
88

99
A strictness annotation (also called a bang: `!`) can be used to denote that a value should not be evaluated lazily.
10-
In some cases this can lead to faster code because fewer heap allocation are required.
10+
In some cases this can lead to faster code because fewer heap allocations are required.
1111
Here it is used to mark a that a field in a datatype should not be evaluated lazily.
1212

1313
However, unlifted types like `Int#` are strict by definition because they are a value,
1414
not a pointer to a potentially unevaluated value (thunk).
1515

16-
Therefore, adding strictness annotations to unlifted types or fields of such types are redundant.
16+
Therefore, adding strictness annotations to unlifted types or fields of such types is redundant.
1717
They should be omitted to avoid confusion.

0 commit comments

Comments
 (0)