Skip to content

Commit d5cdcd8

Browse files
Workaround ghc-typelits-extra#68
See clash-lang/ghc-typelits-extra#68 This currently breaks compiles over at `clash-cores`. See clash-lang/clash-cores#56.
1 parent 9b12c63 commit d5cdcd8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clash-protocols/src/Data/Constraint/Nat/Extra.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ leModulusDivisor :: forall a b. (1 <= b) => Dict (Mod a b + 1 <= b)
1717
leModulusDivisor = unsafeCoerce (Dict :: Dict (0 <= 0))
1818

1919
-- | if (1 <= a) and (1 <= b) then (1 <= DivRU a b)
20-
strictlyPositiveDivRu :: forall a b. (1 <= a, 1 <= b) => Dict (1 <= DivRU a b)
21-
strictlyPositiveDivRu = unsafeCoerce (Dict :: Dict (0 <= 0))
20+
strictlyPositiveDivRu ::
21+
forall a b. (1 <= a, 1 <= b) => Dict ((1 <= DivRU a b) ~ (() :: Constraint))
22+
strictlyPositiveDivRu = unsafeCoerce (Dict :: Dict (() ~ ()))
2223

2324
-- | if (1 <= a) then (b <= ceil(b/a) * a)
2425
leTimesDivRu :: forall a b. (1 <= a) => Dict (b <= a * DivRU b a)

clash-protocols/src/Protocols/PacketStream/Packetizers.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ packetizeFromDfT ::
358358
(KnownNat headerBytes) =>
359359
(KnownNat dataWidth) =>
360360
(1 <= dataWidth) =>
361-
(1 <= headerBytes `DivRU` dataWidth) =>
361+
((1 <= headerBytes `DivRU` dataWidth) ~ (() :: Constraint)) =>
362362
((dataWidth + 1) <= headerBytes) =>
363363
-- | Mapping from `Df` input to output `_meta`
364364
(a -> metaOut) ->

0 commit comments

Comments
 (0)