Skip to content

Commit d98ad49

Browse files
committed
Apply partial applicative operators for Eq and Ord-like functions.
1 parent 86873cf commit d98ad49

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

clash-prelude/tests/Clash/Tests/BlockRam.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ readRam
1414
:: (HiddenClockResetEnable dom)
1515
=> Signal dom (Unsigned 4)
1616
-> Signal dom (Unsigned 8)
17-
readRam addr = mux (register False $ addr .<. 8) ram (pure 0xff)
17+
readRam addr = mux (register False $ addr .< 8) ram (pure 0xff)
1818
where
1919
ram = blockRam1 NoClearOnReset (SNat @8) 0 addr (pure Nothing)
2020

clash-prelude/tests/Clash/Tests/Ram.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ram rd we wr din =
5151

5252
maskOobRead :: Ram
5353
maskOobRead rd we wr din =
54-
maybeIsX <$> mux (rd .<. 2) ram0 (pure 4)
54+
maybeIsX <$> mux (rd .< 2) ram0 (pure 4)
5555
where
5656
ram0 = asyncRam# clockGen clockGen enableGen d2 rd we wr din
5757

tests/shouldfail/Verification/NonTemporal.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ assertCvResult
2525
assertCvResult clk rst gen max results = done
2626
where
2727
counter = register clk rst gen (minBound :: n) (succ <$> counter)
28-
done = hideAssertion results (counter .==. pure maxBound)
28+
done = hideAssertion results (counter .== maxBound)
2929
{-# INLINE assertCvResult #-}
3030

3131
binaryTest

tests/shouldwork/Basic/AES.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ aes
8989
-> Signal dom (BitVector 128)
9090
-> Signal dom (BitVector 128)
9191
-> Signal dom (Unsigned 4, Vec 4 (BitVector 32), BitVector 128, Bool)
92-
aes start key block = bundle (cnt, roundKey, pack <$> roundState, cnt .==. 11)
92+
aes start key block = bundle (cnt, roundKey, pack <$> roundState, cnt .== 11)
9393
where
9494

9595
roundKey :: Signal dom (Vec 4 (BitVector 32))

tests/shouldwork/Issues/T1187/Utils.hs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{-# LANGUAGE ScopedTypeVariables #-}
22
module T1187.Utils
3-
( (.==)
4-
5-
, debounce
3+
( debounce
64

75
, roundRobin
86

@@ -25,18 +23,14 @@ debounce _ initial this = regEn initial stable this
2523
where
2624
counter = register (0 :: Index (ClockDivider dom ps)) counter'
2725
counter' = mux (unchanged initial this) counter 0
28-
stable = counter' .==. pure maxBound
26+
stable = counter' .== maxBound
2927

3028
roundRobin
3129
:: forall n dom. (KnownNat n, HiddenClockResetEnable dom)
3230
=> Signal dom Bool
3331
-> (Signal dom (Vec n Bool), Signal dom (Index n))
3432
roundRobin _next = undefined
3533

36-
infix 4 .==
37-
(.==) :: (Eq a, Functor f) => f a -> a -> f Bool
38-
fx .== y = (== y) <$> fx
39-
4034
moreIdx :: (Eq a, Enum a, Bounded a) => a -> a
4135
moreIdx = fromMaybe maxBound . succIdx
4236

tests/shouldwork/Xilinx/ClockWizard.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ testBench ::
3737
testBench = done
3838
where
3939
(o1, o2) = unbundle $ topEntity clkSE clkDiff rst
40-
done1 = o1 .==. pure maxBound
41-
done2 = o2 .==. pure maxBound
40+
done1 = o1 .== maxBound
41+
done2 = o2 .== maxBound
4242
done = unsafeSynchronizer clockGen clkSE $ fmap endVhdlSim $
4343
strictAnd <$> done1 <*> done2
4444
strictAnd !a !b = a && b

0 commit comments

Comments
 (0)