Skip to content

Commit 502f017

Browse files
committed
Make sop-core forward-compatible with GHC proposal 229
GHC HEAD now implements [proposal 229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst), which makes the parser more sensitive to whitespace around `@` characters in as-patterns. In particular, `@`s in as-patterns are no longer permitted to have preceding or trailing whitespace, which causes `sop-core` to fail to compile on HEAD: ``` [7 of 8] Compiling Data.SOP.Dict ( src/Data/SOP/Dict.hs, interpreted ) src/Data/SOP/Dict.hs:71:1: error: Parse error in pattern: mapAll2 | 71 | mapAll2 f d @ Dict = (all2 . mapAll (mapAll f) . unAll2) d | ^^^^^^^^^^^ ``` The fix is simple: remove the extra whitespace, which this patch accomplishes.
1 parent 2c72353 commit 502f017

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mapAll f Dict = (all_NP . hmap f . unAll_NP) Dict
6868
mapAll2 :: forall c d xss .
6969
(forall a . Dict c a -> Dict d a)
7070
-> Dict (All2 c) xss -> Dict (All2 d) xss
71-
mapAll2 f d @ Dict = (all2 . mapAll (mapAll f) . unAll2) d
71+
mapAll2 f d@Dict = (all2 . mapAll (mapAll f) . unAll2) d
7272

7373
-- | If two constraints 'c' and 'd' hold over a type-level
7474
-- list 'xs', then the combination of both constraints holds
@@ -77,7 +77,7 @@ mapAll2 f d @ Dict = (all2 . mapAll (mapAll f) . unAll2) d
7777
-- @since 0.2
7878
--
7979
zipAll :: Dict (All c) xs -> Dict (All d) xs -> Dict (All (c `And` d)) xs
80-
zipAll dc @ Dict dd = all_NP (hzipWith (\ Dict Dict -> Dict) (unAll_NP dc) (unAll_NP dd))
80+
zipAll dc@Dict dd = all_NP (hzipWith (\ Dict Dict -> Dict) (unAll_NP dc) (unAll_NP dd))
8181

8282
-- | If two constraints 'c' and 'd' hold over a type-level
8383
-- list of lists 'xss', then the combination of both constraints

0 commit comments

Comments
 (0)