Skip to content

Commit 9934ba6

Browse files
committed
Bump typelit plugins
1 parent 5ec337c commit 9934ba6

File tree

8 files changed

+24
-31
lines changed

8 files changed

+24
-31
lines changed

cabal.project

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ write-ghc-environment-files: always
1515
-- index state, to go along with the cabal.project.freeze file. update the index
1616
-- state by running `cabal update` twice and looking at the index state it
1717
-- displays to you (as the second update will be a no-op)
18-
index-state: 2025-07-19T09:09:36Z
18+
index-state: 2025-10-24T02:09:22Z
1919

2020
-- For some reason the `clash-testsuite` executable fails to run without
2121
-- this, as it cannot find the related library...
@@ -59,6 +59,11 @@ optional-packages:
5959
allow-newer:
6060
brick:base,
6161
brick:deepseq,
62+
-- >>> temporarily added for testing purposes
63+
ghc-typelits-knownnat,
64+
ghc-typelits-natnormalise,
65+
ghc-typelits-extra,
66+
-- <<<
6267
hashable,
6368
hedgehog-fakedata:hedgehog,
6469
rewrite-inspector:binary,

clash-ghc/clash-ghc.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ library
170170

171171
clash-lib == 1.9.0,
172172
clash-prelude == 1.9.0,
173-
ghc-typelits-extra >= 0.3.2 && < 0.5,
174-
ghc-typelits-knownnat >= 0.6 && < 0.8,
175-
ghc-typelits-natnormalise >= 0.6 && < 0.8,
173+
ghc-typelits-extra >= 0.3.2 && < 0.6,
174+
ghc-typelits-knownnat >= 0.6 && < 0.9,
175+
ghc-typelits-natnormalise >= 0.6 && < 0.10,
176176
deepseq >= 1.3.0.2 && < 1.6,
177177
time >= 1.4.0.1 && < 1.15,
178178
ghc-boot >= 8.10.0 && < 9.11,

clash-lib-hedgehog/clash-lib-hedgehog.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ library
5252
containers >= 0.5.0.0 && < 0.8,
5353
data-binary-ieee754 >= 0.4.4 && < 0.6,
5454
fakedata >= 1.0.2 && < 1.1,
55-
ghc-typelits-knownnat >= 0.7.2 && < 0.8,
56-
ghc-typelits-natnormalise >= 0.7.2 && < 0.8,
55+
ghc-typelits-knownnat >= 0.7.2 && < 0.9,
56+
ghc-typelits-natnormalise >= 0.7.2 && < 0.10,
5757
hedgehog-fakedata >= 0.0.1.4 && < 0.1,
5858
mmorph >= 1.1.5 && < 1.3,
5959
mtl >= 2.1.2 && < 2.4,

clash-prelude-hedgehog/clash-prelude-hedgehog.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ library
5050

5151
build-depends:
5252
ghc-typelits-knownnat >= 0.7.2 && < 0.8,
53-
ghc-typelits-natnormalise >= 0.7.2 && < 0.8,
53+
ghc-typelits-natnormalise >= 0.7.2 && < 0.10,
5454
text >= 1.2.2 && < 2.2,
5555

5656
clash-prelude == 1.9.0,

clash-prelude/clash-prelude.cabal

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ Library
335335
distributive >= 0.1 && < 1.0,
336336
extra >= 1.6.17 && < 1.9,
337337
ghc-prim >= 0.5.1.0 && < 0.13,
338-
ghc-typelits-extra >= 0.4 && < 0.5,
339-
ghc-typelits-knownnat >= 0.7.2 && < 0.8,
340-
ghc-typelits-natnormalise >= 0.7.2 && < 0.8,
338+
-- >>> lower bounds temporarily increased for testing purposes
339+
ghc-typelits-extra >= 0.5.1 && < 0.6,
340+
ghc-typelits-knownnat >= 0.8.2 && < 0.9,
341+
ghc-typelits-natnormalise >= 0.9.1 && < 0.10,
342+
-- <<<
341343
hashable >= 1.2.1.0 && < 1.6,
342344
half >= 0.2.2.3 && < 1.0,
343345
infinite-list ^>= 0.1,

clash-prelude/src/Clash/Promoted/Nat.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ powUNat x (USucc y) = mulUNat x (powUNat x y)
248248
-- __NB__: Not synthesizable
249249
predUNat :: UNat (n+1) -> UNat n
250250
predUNat (USucc x) = x
251-
#if __GLASGOW_HASKELL__ != 902
252-
predUNat UZero =
253-
error "predUNat: impossible: 0 minus 1, -1 is not a natural number"
254-
#endif
255251

256252
-- | Subtract two unary-encoded natural numbers
257253
--

clash-prelude/src/Clash/Sized/RTree.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,12 @@ instance NFData a => NFData (RTree d a) where
128128

129129
textract :: RTree 0 a -> a
130130
textract (RLeaf x) = x
131-
#if __GLASGOW_HASKELL__ != 902
132-
textract (RBranch _ _) = error $ "textract: nodes hold no values"
133-
#endif
134131
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
135132
{-# CLASH_OPAQUE textract #-}
136133
{-# ANN textract hasBlackBox #-}
137134

138135
tsplit :: RTree (d+1) a -> (RTree d a,RTree d a)
139136
tsplit (RBranch l r) = (l,r)
140-
#if __GLASGOW_HASKELL__ != 902
141-
tsplit (RLeaf _) = error $ "tsplit: leaf is atomic"
142-
#endif
143137
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
144138
{-# CLASH_OPAQUE tsplit #-}
145139
{-# ANN tsplit hasBlackBox #-}

clash-prelude/src/Clash/Sized/Vector.hs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,17 +2654,13 @@ dtfold :: forall p k a . KnownNat k
26542654
dtfold _ f g = go (SNat :: SNat k)
26552655
where
26562656
go :: forall n . SNat n -> Vec (2^n) a -> (p @@ n)
2657-
go _ (x `Cons` Nil) = f x
2658-
go sn xs@(Cons _ (Cons _ _)) =
2659-
let sn' :: SNat (n - 1)
2660-
sn' = sn `subSNat` d1
2661-
(xsL,xsR) = splitAt (pow2SNat sn') xs
2662-
in g sn' (go sn' xsL) (go sn' xsR)
2663-
#if !MIN_VERSION_base(4,16,0) || MIN_VERSION_base(4,17,0)
2664-
go _ Nil =
2665-
case (const Dict :: forall m. Proxy m -> Dict (1 <= 2 ^ m)) (Proxy @n) of
2666-
{}
2667-
#endif
2657+
go sn = case toUNat sn of
2658+
UZero -> f . head
2659+
USucc _ -> \xs ->
2660+
let sn' :: SNat (n - 1)
2661+
sn' = sn `subSNat` d1
2662+
(xsL,xsR) = splitAt (pow2SNat sn') xs
2663+
in g sn' (go sn' xsL) (go sn' xsR)
26682664
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
26692665
{-# CLASH_OPAQUE dtfold #-}
26702666
{-# ANN dtfold hasBlackBox #-}

0 commit comments

Comments
 (0)