Skip to content

Commit

Permalink
Fix incorrect text in Haddock
Browse files Browse the repository at this point in the history
  • Loading branch information
jvnknvlgl committed Aug 2, 2024
1 parent fd790c0 commit dd3c71c
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions clash-prelude/src/Clash/Class/Resize.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ maybeIntegral Proxy v =
&& toInteger v > toInteger (minBound @b)

-- | Like 'fromIntegral', but returns 'Nothing' if /a/ is out of bounds for /b/.
-- Useful when you "know" /a/ can't be out of bounds, but would like to have your
-- assumptions checked.
--
-- * __NB__: Check only affects simulation. I.e., no checks will be inserted
-- into the generated HDL
-- Useful when you do not know /a/ can be out of bounds, and would like to have
-- your assumptions checked.

-- * __NB__: 'fromIntegral' is not well suited for Clash as it will go through
-- 'Integer' which is arbitrarily bounded in HDL. Instead use
-- 'Clash.Class.BitPack.bitCoerce' and the 'Resize' class.
Expand All @@ -150,11 +148,8 @@ maybeFromIntegral v =
else Nothing

-- | Like 'resize', but returns 'Nothing' if /f a/ is out of bounds for /f b/.
-- Useful when you "know" /f a/ can't be out of bounds, but would like to have your
-- assumptions checked.
--
-- __NB__: Check only affects simulation. I.e., no checks will be inserted
-- into the generated HDL
-- Useful when you do not know /f a/ can be out of bounds, and would like to
-- have your assumptions checked.
maybeResize ::
forall a b f.
( Resize f
Expand All @@ -167,11 +162,8 @@ maybeResize v =
else Nothing

-- | Like 'truncateB', but returns 'Nothing' if /f (a + b)/ is out of bounds for
-- /f a/. Useful when you "know" /f (a + b)/ can't be out of bounds, but would
-- like to have your assumptions checked.
--
-- __NB__: Check only affects simulation. I.e., no checks will be inserted
-- into the generated HDL
-- /f a/. Useful when you do not know /f (a + b)/ can be out of bounds, and
-- would like to have your assumptions checked.
maybeTruncateB ::
forall a b f.
( HasCallStack
Expand Down

0 comments on commit dd3c71c

Please sign in to comment.