Skip to content

Commit

Permalink
Haddock: Fix very confusing formatting errors
Browse files Browse the repository at this point in the history
Because of mistakes escaping special characters, some documentation
showed the operators `$` and `*` where the Functor and Applicative
operators were intended. Since they are all very common operators, this
can be very confusing to the reader.

Additionally, it was discovered that later versions of Haddock start
interpreting Markdown-style links in code blocks, breaking the
rendering of the primitive blackboxes in `Clash.Tutorial`. This problem
does not occur with GHC 9.0.2 (Haddock 2.25.1), which we use to build
the documentation for Hackage. But it does occur with at least GHC 9.6.
  • Loading branch information
DigitalBrains1 committed Dec 14, 2023
1 parent 930641c commit 386c639
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions clash-prelude/src/Clash/Explicit/Testbench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ tbEnableGen = toEnable (pure True)
-- where
-- testInput = pure ((1 :> 2 :> 3 :> Nil) :> (4 :> 5 :> 6 :> Nil) :> Nil)
-- expectedOutput = outputVerifier' ((1:>2:>3:>4:>5:>6:>Nil):>Nil)
-- done = exposeClockResetEnable (expectedOutput (topEntity <$> testInput)) clk rst
-- clk = 'tbSystemClockGen' (not <\$\> done)
-- done = exposeClockResetEnable (expectedOutput (topEntity \<\$> testInput)) clk rst
-- clk = 'tbSystemClockGen' (not \<\$> done)
-- rst = systemResetGen
-- @
tbSystemClockGen
Expand Down
4 changes: 2 additions & 2 deletions clash-prelude/src/Clash/Signal/Bundle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ import Clash.Sized.RTree (RTree, lazyT)
-- type Unbundled dom (Pair a b) = Pair (Signal dom a) (Signal dom b)
--
-- -- bundle :: Pair (Signal dom a) (Signal dom b) -> Signal dom (Pair a b)
-- bundle (MkPair as bs) = MkPair <$> as <*> bs
-- bundle (MkPair as bs) = MkPair '<$>' as '<*>' bs
--
-- -- unbundle :: Signal dom (Pair a b) -> Pair (Signal dom a) (Signal dom b)
-- unbundle pairs = MkPair (getA <$> pairs) (getB <$> pairs)
-- unbundle pairs = MkPair (getA '<$>' pairs) (getB '<$>' pairs)
-- @

class Bundle a where
Expand Down
1 change: 1 addition & 0 deletions clash-prelude/src/Clash/Sized/RTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ We have such an adder in the form of the 'Clash.Class.Num.add' function, as
defined in the instance 'Clash.Class.Num.ExtendingNum' instance of 'Index'.
However, we cannot simply use 'Clash.Sized.Vector.fold' to create a tree-structure of
'Clash.Class.Num.add's:
#if __GLASGOW_HASKELL__ >= 900
>>> :{
let populationCount' :: (KnownNat (2^d), KnownNat d, KnownNat (2^d+1))
Expand Down
8 changes: 4 additions & 4 deletions clash-prelude/src/Clash/Tutorial.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,9 @@ BlackBox:
begin
if ~IF~ACTIVEEDGE[Rising][0]~THENrising_edge~ELSEfalling_edge~FI(~ARG[3]) then
if ~ARG[7] ~IF ~ISACTIVEENABLE[4] ~THEN and ~ARG[4] ~ELSE ~FI then
~SYM[2](~SYM[5]) <= ~TOBV[~ARG[9]][~TYP[9]];
~SYM\[2](~SYM[5]) <= ~TOBV[~ARG[9]][~TYP[9]];
end if;
~RESULT <= fromSLV(~SYM[2](~SYM[4]))
~RESULT <= fromSLV(~SYM\[2](~SYM[4]))
-- pragma translate_off
after 1 ps
-- pragma translate_on
Expand All @@ -1200,9 +1200,9 @@ BlackBox:
begin
if ~IF~ACTIVEEDGE[Rising][0]~THENrising_edge~ELSEfalling_edge~FI(~ARG[3]) then
if ~ARG[7] ~IF ~ISACTIVEENABLE[4] ~THEN and ~ARG[4] ~ELSE ~FI then
~SYM[2](~SYM[5]) <= ~ARG[9];
~SYM\[2](~SYM[5]) <= ~ARG[9];
end if;
~RESULT <= ~SYM[2](~SYM[4])
~RESULT <= ~SYM\[2](~SYM[4])
-- pragma translate_off
after 1 ps
-- pragma translate_on
Expand Down

0 comments on commit 386c639

Please sign in to comment.