clash-compiler icon indicating copy to clipboard operation
clash-compiler copied to clipboard

Malformed haddock in `clash-prelude`

Open alex-mckenna opened this issue 2 years ago • 1 comments

The API documentation for head and tail for the current stable version of Clash is slightly malformed, resulting in the documentation being rendered badly. I see:

Screenshot from 2022-07-10 17-53-58

Looking at the source, the functions causing problems attempt to use the preprocessor to change what is displayed:

{- | Extract the first element of a vector

>>> head (1:>2:>3:>Nil)
1

#if __GLASGOW_HASKELL__ >= 900
>>> head Nil
<BLANKLINE>
<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected: Vec (0 + 1) a
        Actual: Vec 0 a
    • In the first argument of ‘head’, namely ‘Nil’
      In the expression: head Nil
      In an equation for ‘it’: it = head Nil

#else
>>> head Nil
<BLANKLINE>
<interactive>:...
    • Couldn't match type ‘1’ with ‘0’
      Expected type: Vec (0 + 1) a
        Actual type: Vec 0 a
    • In the first argument of ‘head’, namely ‘Nil’
      In the expression: head Nil
      In an equation for ‘it’: it = head Nil

#endif
-}

alex-mckenna avatar Jul 10 '22 15:07 alex-mckenna

That is caused by https://github.com/haskell/haddock/issues/1382

leonschoorl avatar Jul 19 '22 18:07 leonschoorl