File tree 5 files changed +53
-4
lines changed 5 files changed +53
-4
lines changed Original file line number Diff line number Diff line change 36
36
- run : cabal test $CONFIG
37
37
- run : cabal haddock $CONFIG
38
38
- run : cabal sdist
39
+
40
+ check-changelogs :
41
+ name : Check changelogs
42
+ runs-on : ubuntu-latest
43
+ defaults :
44
+ run :
45
+ shell : bash
46
+
47
+ steps :
48
+ - name : Install dependencies
49
+ run : sudo apt install -y fd-find
50
+
51
+ - uses : actions/checkout@v3
52
+
53
+ - name : git fetch
54
+ run : git fetch origin master:master
55
+
56
+ - name : Check changelogs
57
+ run : ./scripts/check-changelogs.sh
Original file line number Diff line number Diff line change 1
1
# Revision history for nothunks
2
2
3
+ ## next version
4
+
5
+ * ` NoThunks ThreadId ` instance
6
+
3
7
## 0.1.4 -- 2023-03-27
4
8
5
9
* Made cabal flags manual.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ FD=" $( which fdfind 2> /dev/null || which fd 2> /dev/null) "
4
+
5
+ set -eo pipefail
6
+
7
+ function check_project () {
8
+ project=$1
9
+ n=$( )
10
+ if [[ -n $( git diff --name-only origin/master..HEAD -- $project ) ]]; then
11
+ if [[ -z $( git diff --name-only origin/master..HEAD -- $project /CHANGELOG.md) ]]; then
12
+ echo " $project was modified but its CHANGELOG was not updated"
13
+ exit 1
14
+ fi
15
+ fi
16
+ }
17
+
18
+ for cbl in $( $FD -e ' cabal' ) ; do
19
+ check_project $( dirname $cbl )
20
+ done
21
+
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import GHC.Exts.Heap
43
43
import GHC.Generics
44
44
import GHC.Records
45
45
import GHC.TypeLits
46
+ import GHC.Conc.Sync (ThreadId (.. ))
46
47
47
48
-- For instances
48
49
@@ -427,10 +428,12 @@ instance GWNoThunks a V1 where
427
428
-------------------------------------------------------------------------------}
428
429
429
430
-- | If @fieldName@ is allowed to contain thunks, skip it.
430
- instance GWRecordField f (Elem fieldName a )
431
+ instance ( GWRecordField f (Elem fieldName a )
432
+ , KnownSymbol fieldName
433
+ )
431
434
=> GWNoThunks a (S1 ('MetaSel ('Just fieldName ) su ss ds ) f ) where
432
435
gwNoThunks _ ctxt (M1 fp) =
433
- gwRecordField (Proxy @ (Elem fieldName a )) ctxt fp
436
+ gwRecordField (Proxy @ (Elem fieldName a )) (symbolVal @ fieldName Proxy : ctxt) fp
434
437
435
438
class GWRecordField f (b :: Bool ) where
436
439
gwRecordField :: proxy b -> Context -> f x -> IO (Maybe ThunkInfo )
@@ -640,6 +643,8 @@ instance NoThunks a => NoThunks (NonEmpty a)
640
643
641
644
instance (NoThunks a , NoThunks b ) => NoThunks (Either a b )
642
645
646
+ deriving via InspectHeap ThreadId instance NoThunks ThreadId
647
+
643
648
{- ------------------------------------------------------------------------------
644
649
Spine-strict container types
645
650
Original file line number Diff line number Diff line change @@ -333,13 +333,13 @@ instance FromModel (AllowThunksIn '["field1"] Record) where
333
333
334
334
modelIsNF ctxt = \ case
335
335
RecordThunk _ -> NotWHNF ctxt'
336
- RecordDefined a b -> constrNF [modelIsNF ctxt' a , modelIsNF ctxt' b ]
336
+ RecordDefined a b -> constrNF [modelIsNF ( " field1 " : ctxt' ) a , modelIsNF ( " field2 " : ctxt' ) b ]
337
337
where
338
338
ctxt' = " Record" : ctxt
339
339
340
340
modelUnexpected ctxt = \ case
341
341
RecordThunk _ -> Just ctxt'
342
- RecordDefined _ y -> modelUnexpected ctxt' y
342
+ RecordDefined _ y -> modelUnexpected ( " field2 " : ctxt' ) y
343
343
where
344
344
ctxt' = " Record" : ctxt
345
345
You can’t perform that action at this time.
0 commit comments