clash-prelude-1.8.4: Clash: a functional hardware description language - Prelude library

Copyright | (C) 2016 University of Twente 2017 QBayLogic Google Inc. 2017-2019 Myrtle Software Ltd 2021-2025 QBayLogic B.V.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Trustworthy
Language | Haskell2010

Clash.XException

Contents

- `XException`: An exception for uninitialized values
- Printing `XException`s as `undefined`
- Strict evaluation
- Structured undefined / deep evaluation with undefined values

Description

`XException`: An exception for uninitialized values

    >>> show (errorX "No value here" :: Integer, 4 :: Int)
    "(*** Exception: X: No value here
    CallStack (from HasCallStack):
    ...
    >>> showX (errorX "No value here" :: Integer, 4 :: Int)
    "(undefined,4)"

Synopsis

- newtype XException = XException String
- errorX :: HasCallStack => String -> a
- isX :: a -> Either String a
- hasX :: (NFData a, NFDataX a) => a -> Either String a
- maybeIsX :: a -> Maybe a
- maybeHasX :: (NFData a, NFDataX a) => a -> Maybe a
- fromJustX :: (HasCallStack, NFDataX a) => Maybe a -> a
- undefined :: HasCallStack => a
- xToErrorCtx :: String -> a -> a
- xToError :: HasCallStack => a -> a
- class ShowX a where
  - showsPrecX :: Int -> a -> ShowS
  - showX :: a -> String
  - showListX :: [a] -> ShowS
- showsX :: ShowX a => a -> ShowS
- printX :: ShowX a => a -> IO ()
- showsPrecXWith :: (Int -> a -> ShowS) -> Int -> a -> ShowS
- seqX :: a -> b -> b
- seqErrorX :: a -> b -> b
- forceX :: NFDataX a => a -> a
- deepseqX :: NFDataX a => a -> b -> b
- rwhnfX :: a -> ()
- defaultSeqX :: NFDataX a => a -> b -> b
- hwSeqX :: a -> b -> b
- class NFDataX a where
  - deepErrorX :: String -> a
  - hasUndefined :: a -> Bool
  - ensureSpine :: a -> a
  - rnfX :: a -> ()

# `XException`: An exception for uninitialized values

newtype XException Source #

An exception representing an "uninitialized" value.

Constructors

XException String |

#### Instances

Instances details

Exception XException Source # |
Instance details Defined in Clash.XException.Internal Methods toException :: XException -> SomeException Source # fromException :: SomeException -> Maybe XException Source # displayException :: XException -> String Source # backtraceDesired :: XException -> Bool Source #
Show XException Source # |
Instance details Defined in Clash.XException.Internal Methods showsPrec :: Int -> XException -> ShowS Source # show :: XException -> String Source # showList :: [XException] -> ShowS Source #

errorX :: HasCallStack => String -> a Source #

Like `error`, but throwing an `XException` instead of an `ErrorCall`

The `ShowX` methods print these error-values as `undefined`; instead of error'ing out with an exception.

isX :: a -> Either String a Source #

Evaluate a value to WHNF, returning ``Left` msg` if is a `XException`.

    isX 42                  = Right 42
    isX (XException msg)    = Left msg
    isX (3, XException msg) = Right (3, XException msg)
    isX (3, _|_)            = Right (3, _|_)
    isX _|_                 = _|_

hasX :: (NFData a, NFDataX a) => a -> Either String a Source #

Fully evaluate a value, returning ``Left` msg` if it throws `XException`. If you want to determine if a value contains undefined parts, use `hasUndefined` instead.

    hasX 42                    = Right 42
    hasX (XException msg)      = Left msg
    hasX (3, XException msg)   = Left msg
    hasX (XException msg, _|_) = _|_
    hasX (_|_, XException msg) = _|_
    hasX (3, _|_)              = _|_
    hasX _|_                   = _|_

If a data structure contains multiple `XException`s, the "first" message is picked according to the implementation of `rnfX`.

maybeIsX :: a -> Maybe a Source #

Evaluate a value to WHNF, returning `Nothing` if it throws `XException`.

    maybeIsX 42                  = Just 42
    maybeIsX (XException msg)    = Nothing
    maybeIsX (3, XException msg) = Just (3, XException msg)
    maybeIsX (3, _|_)            = Just (3, _|_)
    maybeIsX _|_                 = _|_

maybeHasX :: (NFData a, NFDataX a) => a -> Maybe a Source #

Fully evaluate a value, returning `Nothing` if it throws `XException`. Note that non-`XException` errors take precedence over `XException` ones.

    maybeHasX 42                    = Just 42
    maybeHasX (XException msg)      = Nothing
    maybeHasX (3, XException msg)   = Nothing
    maybeHasX (XException msg, _|_) = _|_
    maybeHasX (_|_, XException msg) = _|_
    maybeHasX (3, _|_)              = _|_
    maybeHasX _|_                   = _|_

fromJustX :: (HasCallStack, NFDataX a) => Maybe a -> a Source #

Same as `fromJust`, but returns a bottom/undefined value that other Clash constructs are aware of.

undefined :: HasCallStack => a Source #

Call to `errorX` with default string

xToErrorCtx :: String -> a -> a Source #

Convert `XException` to `ErrorCall`

This is useful when tracking the source of `XException` that gets eaten up by `pack` inside of your circuit; since `pack` translates `XException` into undefined bits.

So for example if you have some large function f:

    f a b = ... pack a ... pack b ...

Where it is basically an error if either a or b ever throws an `XException`, and so you want that to be reported the moment a or b is used, instead of it being thrown when evaluating the result of f, then do:

    {-# LANGUAGE ViewPatterns #-}
    f (xToErrorCtx "a is X" -> a) (xToErrorCtx "b is X" -> b) = ...

Where we pass an extra string, for context, to know which argument evaluated to an `XException`. We can also use BangPatterns to report the potential `XException` being thrown by a or b even earlier, i.e. when f is applied:

    {-# LANGUAGE ViewPatterns, BangPatterns #-}
    f (xToErrorCtx "a is X" -> !a) (xToErrorCtx "b is X" -> !b) = ...

NB: Fully synthesizable, so doesn't have to be removed before synthesis

### Example

Expand

    >>> :set -XViewPatterns -XDataKinds
    >>> import Clash.Sized.BitVector
    >>> import GHC.Stack
    >>> :{
    let h, h' :: Bit -> BitVector 8 -> BitVector 8
        h (xToErrorCtx "a is X" -> a) (xToErrorCtx "b is X" -> b) = slice d7 d0 (pack a ++# b)
        h' a b = slice d7 d0 (pack a ++# b)
    :}

    >>> h' (errorX "QQ") 3
    0b0000_0011
    >>> h (errorX "QQ") 3
    *** Exception: a is X
    X: QQ
    CallStack (from HasCallStack):
      errorX, called at ...

xToError :: HasCallStack => a -> a Source #

Convert `XException` to `ErrorCall`

This is useful when tracking the source of `XException` that gets eaten up by `pack` inside of your circuit; since `pack` translates `XException` into undefined bits.

So for example if you have some large function f:

    f a b = ... pack a ... pack b ...

Where it is basically an error if either a or b ever throws an `XException`, and so you want that to be reported the moment a or b is used, instead of it being thrown when evaluating the result of f, then do:

    {-# LANGUAGE ViewPatterns #-}
    f (xToError -> a) (xToError -> b) = ...

Unlike `xToErrorCtx`, where we have an extra String argument to distinguish one call to `xToError` to the other, `xToError` will use the `CallStack` mechanism to aid the user in distinguishing different call to `xToError`. We can also use BangPatterns to report the potential `XException` being thrown by a or b even earlier, i.e. when f is applied:

    {-# LANGUAGE ViewPatterns, BangPatterns #-}
    f (xToError -> !a) (xToError -> !b) = ...

NB: Fully synthesizable, so doesn't have to be removed before synthesis

### Example

Expand

    >>> :set -XViewPatterns -XDataKinds
    >>> import Clash.Sized.BitVector
    >>> import GHC.Stack
    >>> :{
    let f, g, h, h' :: HasCallStack => Bit -> BitVector 8 -> BitVector 8
        f = g
        g = h
        h (xToError -> a) (xToError -> b) = slice d7 d0 (pack a ++# b)
        h' a b = slice d7 d0 (pack a ++# b)
    :}

    >>> h' (errorX "QQ") 3
    0b0000_0011
    >>> f (errorX "QQ") 3
    *** Exception: CallStack (from HasCallStack):
      xToError, called at ...
      h, called at ...
      g, called at ...
      f, called at ...
    X: QQ
    CallStack (from HasCallStack):
      errorX, called at ...

# Printing `XException`s as `undefined`

class ShowX a where Source #

Like the `Show` class, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception.

    >>> show (errorX "No value here" :: Integer, 4 :: Int)
    "(*** Exception: X: No value here
    CallStack (from HasCallStack):
    ...
    >>> showX (errorX "No value here" :: Integer, 4 :: Int)
    "(undefined,4)"

Can be derived using `Generics`:

    {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}

    import Clash.Prelude
    import GHC.Generics

    data T = MkTA Int | MkTB Bool
      deriving (Show,Generic,ShowX)

Minimal complete definition

Nothing

Methods

showsPrecX :: Int -> a -> ShowS Source #

Like `showsPrec`, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception.

default showsPrecX :: (Generic a, GShowX (Rep a)) => Int -> a -> ShowS Source #

showX :: a -> String Source #

Like `show`, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception.

showListX :: [a] -> ShowS Source #

Like `showList`, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception.

#### Instances

Instances details

ShowX Bit Source # |
Instance details Defined in Clash.Sized.Internal.BitVector Methods showsPrecX :: Int -> Bit -> ShowS Source # showX :: Bit -> String Source # showListX :: [Bit] -> ShowS Source #
ShowX Int16 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Int16 -> ShowS Source # showX :: Int16 -> String Source # showListX :: [Int16] -> ShowS Source #
ShowX Int32 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Int32 -> ShowS Source # showX :: Int32 -> String Source # showListX :: [Int32] -> ShowS Source #
ShowX Int64 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Int64 -> ShowS Source # showX :: Int64 -> String Source # showListX :: [Int64] -> ShowS Source #
ShowX Int8 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Int8 -> ShowS Source # showX :: Int8 -> String Source # showListX :: [Int8] -> ShowS Source #
ShowX Word16 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Word16 -> ShowS Source # showX :: Word16 -> String Source # showListX :: [Word16] -> ShowS Source #
ShowX Word32 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Word32 -> ShowS Source # showX :: Word32 -> String Source # showListX :: [Word32] -> ShowS Source #
ShowX Word64 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Word64 -> ShowS Source # showX :: Word64 -> String Source # showListX :: [Word64] -> ShowS Source #
ShowX Word8 Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Word8 -> ShowS Source # showX :: Word8 -> String Source # showListX :: [Word8] -> ShowS Source #
ShowX Ordering Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Ordering -> ShowS Source # showX :: Ordering -> String Source # showListX :: [Ordering] -> ShowS Source #
ShowX Integer Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Integer -> ShowS Source # showX :: Integer -> String Source # showListX :: [Integer] -> ShowS Source #
ShowX Natural Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Natural -> ShowS Source # showX :: Natural -> String Source # showListX :: [Natural] -> ShowS Source #
ShowX String Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> String -> ShowS Source # showX :: String -> String Source # showListX :: [String] -> ShowS Source #
ShowX () Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> () -> ShowS Source # showX :: () -> String Source # showListX :: [()] -> ShowS Source #
ShowX Bool Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Bool -> ShowS Source # showX :: Bool -> String Source # showListX :: [Bool] -> ShowS Source #
ShowX Char Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Char -> ShowS Source # showX :: Char -> String Source # showListX :: [Char] -> ShowS Source #
ShowX Double Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Double -> ShowS Source # showX :: Double -> String Source # showListX :: [Double] -> ShowS Source #
ShowX Float Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Float -> ShowS Source # showX :: Float -> String Source # showListX :: [Float] -> ShowS Source #
ShowX Int Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Int -> ShowS Source # showX :: Int -> String Source # showListX :: [Int] -> ShowS Source #
ShowX Word Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Word -> ShowS Source # showX :: Word -> String Source # showListX :: [Word] -> ShowS Source #
ShowX a => ShowX (Complex a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Complex a -> ShowS Source # showX :: Complex a -> String Source # showListX :: [Complex a] -> ShowS Source #
ShowX a => ShowX (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods showsPrecX :: Int -> Erroring a -> ShowS Source # showX :: Erroring a -> String Source # showListX :: [Erroring a] -> ShowS Source #
ShowX a => ShowX (Overflowing a) Source # |
Instance details Defined in Clash.Num.Overflowing Methods showsPrecX :: Int -> Overflowing a -> ShowS Source # showX :: Overflowing a -> String Source # showListX :: [Overflowing a] -> ShowS Source #
ShowX a => ShowX (Saturating a) Source # |
Instance details Defined in Clash.Num.Saturating Methods showsPrecX :: Int -> Saturating a -> ShowS Source # showX :: Saturating a -> String Source # showListX :: [Saturating a] -> ShowS Source #
ShowX a => ShowX (Wrapping a) Source # |
Instance details Defined in Clash.Num.Wrapping Methods showsPrecX :: Int -> Wrapping a -> ShowS Source # showX :: Wrapping a -> String Source # showListX :: [Wrapping a] -> ShowS Source #
ShowX a => ShowX (Zeroing a) Source # |
Instance details Defined in Clash.Num.Zeroing Methods showsPrecX :: Int -> Zeroing a -> ShowS Source # showX :: Zeroing a -> String Source # showListX :: [Zeroing a] -> ShowS Source #
KnownNat n => ShowX (BNat n) Source # |
Instance details Defined in Clash.Promoted.Nat Methods showsPrecX :: Int -> BNat n -> ShowS Source # showX :: BNat n -> String Source # showListX :: [BNat n] -> ShowS Source #
ShowX (SNat n) Source # |
Instance details Defined in Clash.Promoted.Nat Methods showsPrecX :: Int -> SNat n -> ShowS Source # showX :: SNat n -> String Source # showListX :: [SNat n] -> ShowS Source #
KnownNat n => ShowX (UNat n) Source # |
Instance details Defined in Clash.Promoted.Nat Methods showsPrecX :: Int -> UNat n -> ShowS Source # showX :: UNat n -> String Source # showListX :: [UNat n] -> ShowS Source #
KnownNat n => ShowX (BitVector n) Source # |
Instance details Defined in Clash.Sized.Internal.BitVector Methods showsPrecX :: Int -> BitVector n -> ShowS Source # showX :: BitVector n -> String Source # showListX :: [BitVector n] -> ShowS Source #
ShowX (Index n) Source # |
Instance details Defined in Clash.Sized.Internal.Index Methods showsPrecX :: Int -> Index n -> ShowS Source # showX :: Index n -> String Source # showListX :: [Index n] -> ShowS Source #
ShowX (Signed n) Source # |
Instance details Defined in Clash.Sized.Internal.Signed Methods showsPrecX :: Int -> Signed n -> ShowS Source # showX :: Signed n -> String Source # showListX :: [Signed n] -> ShowS Source #
ShowX (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods showsPrecX :: Int -> Unsigned n -> ShowS Source # showX :: Unsigned n -> String Source # showListX :: [Unsigned n] -> ShowS Source #
ShowX a => ShowX (Seq a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Seq a -> ShowS Source # showX :: Seq a -> String Source # showListX :: [Seq a] -> ShowS Source #
ShowX a => ShowX (Identity a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Identity a -> ShowS Source # showX :: Identity a -> String Source # showListX :: [Identity a] -> ShowS Source #
ShowX a => ShowX (Down a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Down a -> ShowS Source # showX :: Down a -> String Source # showListX :: [Down a] -> ShowS Source #
ShowX a => ShowX (Ratio a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Ratio a -> ShowS Source # showX :: Ratio a -> String Source # showListX :: [Ratio a] -> ShowS Source #
ShowX a => ShowX (Maybe a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Maybe a -> ShowS Source # showX :: Maybe a -> String Source # showListX :: [Maybe a] -> ShowS Source #
ShowX a => ShowX [a] Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> [a] -> ShowS Source # showX :: [a] -> String Source # showListX :: [[a]] -> ShowS Source #
ShowX a => ShowX (RTree n a) Source # |
Instance details Defined in Clash.Sized.RTree Methods showsPrecX :: Int -> RTree n a -> ShowS Source # showX :: RTree n a -> String Source # showListX :: [RTree n a] -> ShowS Source #
ShowX a => ShowX (Vec n a) Source # |
Instance details Defined in Clash.Sized.Vector Methods showsPrecX :: Int -> Vec n a -> ShowS Source # showX :: Vec n a -> String Source # showListX :: [Vec n a] -> ShowS Source #
(ShowX a, ShowX b) => ShowX (Either a b) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Either a b -> ShowS Source # showX :: Either a b -> String Source # showListX :: [Either a b] -> ShowS Source #
ShowX (Proxy a) Source # | Since: 1.8.2
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Proxy a -> ShowS Source # showX :: Proxy a -> String Source # showListX :: [Proxy a] -> ShowS Source #
(ShowX a0, ShowX a1) => ShowX (a0, a1) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1) -> ShowS Source # showX :: (a0, a1) -> String Source # showListX :: [(a0, a1)] -> ShowS Source #
(size ~ (int + frac), KnownNat frac, Integral (rep size)) => ShowX (Fixed rep int frac) Source # |
Instance details Defined in Clash.Sized.Fixed Methods showsPrecX :: Int -> Fixed rep int frac -> ShowS Source # showX :: Fixed rep int frac -> String Source # showListX :: [Fixed rep int frac] -> ShowS Source #
ShowX a => ShowX (Const a b) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Const a b -> ShowS Source # showX :: Const a b -> String Source # showListX :: [Const a b] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2) => ShowX (a0, a1, a2) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2) -> ShowS Source # showX :: (a0, a1, a2) -> String Source # showListX :: [(a0, a1, a2)] -> ShowS Source #
(ShowX (f a), ShowX (g a)) => ShowX (Product f g a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Product f g a -> ShowS Source # showX :: Product f g a -> String Source # showListX :: [Product f g a] -> ShowS Source #
(ShowX (f a), ShowX (g a)) => ShowX (Sum f g a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Sum f g a -> ShowS Source # showX :: Sum f g a -> String Source # showListX :: [Sum f g a] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3) => ShowX (a0, a1, a2, a3) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3) -> ShowS Source # showX :: (a0, a1, a2, a3) -> String Source # showListX :: [(a0, a1, a2, a3)] -> ShowS Source #
ShowX (f (g a)) => ShowX (Compose f g a) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> Compose f g a -> ShowS Source # showX :: Compose f g a -> String Source # showListX :: [Compose f g a] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4) => ShowX (a0, a1, a2, a3, a4) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4) -> ShowS Source # showX :: (a0, a1, a2, a3, a4) -> String Source # showListX :: [(a0, a1, a2, a3, a4)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5) => ShowX (a0, a1, a2, a3, a4, a5) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6) => ShowX (a0, a1, a2, a3, a4, a5, a6) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6, ShowX a7) => ShowX (a0, a1, a2, a3, a4, a5, a6, a7) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6, a7) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6, a7) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6, a7)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6, ShowX a7, ShowX a8) => ShowX (a0, a1, a2, a3, a4, a5, a6, a7, a8) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6, a7, a8) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6, a7, a8)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6, ShowX a7, ShowX a8, ShowX a9) => ShowX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)] -> ShowS Source #
(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6, ShowX a7, ShowX a8, ShowX a9, ShowX a10) => ShowX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # |
Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)] -> ShowS Source #

(ShowX a0, ShowX a1, ShowX a2, ShowX a3, ShowX a4, ShowX a5, ShowX a6, ShowX a7, ShowX a8, ShowX a9, ShowX a10, ShowX a11) => ShowX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

NB: The documentation only shows instances up to 3-tuples. By default, instances up to and including 12-tuples will exist. If the flag `large-tuples` is set instances up to the GHC imposed limit will exist. The GHC imposed limit is either 62 or 64 depending on the GHC version.

Instance details Defined in Clash.XException Methods showsPrecX :: Int -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> ShowS Source # showX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> String Source # showListX :: [(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)] -> ShowS Source #

showsX :: ShowX a => a -> ShowS Source #

Like `shows`, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception.

printX :: ShowX a => a -> IO () Source #

Like `print`, but values that normally throw an `XException` are converted to `undefined`, instead of error'ing out with an exception

showsPrecXWith :: (Int -> a -> ShowS) -> Int -> a -> ShowS Source #

Use when you want to create a `ShowX` instance where:

- There is no `Generic` instance for your data type
- The `Generic` derived ShowX method would traverse into the (hidden) implementation details of your data type, and you just want to show the entire value as `undefined`.

Can be used like:

    data T = ...

    instance Show T where ...

    instance ShowX T where
      showsPrecX = showsPrecXWith showsPrec

# Strict evaluation

seqX :: a -> b -> b infixr 0 Source #

Like `seq`, however, whereas `seq` will always do:

    seq  _|_              b = _|_

`seqX` will do:

    seqX (XException msg) b = b
    seqX _|_              b = _|_

seqErrorX :: a -> b -> b infixr 0 Source #

Like `seqX`, but will also catch ErrorCall exceptions which are thrown. This should be used with care.

    seqErrorX (ErrorCall msg)  b = b
    seqErrorX (XException msg) b = b
    seqErrorX _|_              b = _|_

forceX :: NFDataX a => a -> a Source #

a variant of `deepseqX` that is useful in some circumstances:

    forceX x = x `deepseqX` x

deepseqX :: NFDataX a => a -> b -> b infixr 0 Source #

`deepseqX`: fully evaluates the first argument, before returning the second. Does not propagate `XException`s.

rwhnfX :: a -> () Source #

Reduce to weak head normal form

Equivalent to `\x -> `seqX` x ()`.

Useful for defining `rnfX` for types for which NF=WHNF holds.

defaultSeqX :: NFDataX a => a -> b -> b infixr 0 Source #

Either `seqX` or `deepseqX` depending on the value of the cabal flag '-fsuper-strict'. If enabled, `defaultSeqX` will be `deepseqX`, otherwise `seqX`. Flag defaults to false and thus `seqX`.

hwSeqX :: a -> b -> b infixr 0 Source #

Like `seqX` in simulation, but will force its first argument to be rendered in HDL. This is useful for components that need to be rendered in hardware, but otherwise have no meaning in simulation. An example of such a component would be an ILA: a component monitoring an internal signal of a design. The output of such a component (typically a unit) can be passed as the first argument to `hwSeqX` to ensure the ILA ends up in the generated HDL.

NB: The result of `hwSeqX` must (indirectly) be used at the very top of a design. If it's not, Clash will remove it like it does for any other unused circuit parts.

NB: Make sure the blackbox for the component with zero-width results uses `RenderVoid`

# Structured undefined / deep evaluation with undefined values

class NFDataX a where Source #

Class that houses functions dealing with undefined values in Clash. See `deepErrorX` and `rnfX`.

Minimal complete definition

Nothing

Methods

deepErrorX :: String -> a Source #

Create a value where all the elements have an `errorX`, but the spine is defined.

default deepErrorX :: (HasCallStack, Generic a, GDeepErrorX (Rep a)) => String -> a Source #

hasUndefined :: a -> Bool Source #

Determines whether any of parts of a given construct contain undefined parts. Note that a negative answer does not mean its bit representation is fully defined. For example:

    >>> m = Nothing :: Maybe Bool
    >>> hasUndefined m
    False
    >>> pack m
    0b0.
    >>> hasUndefined (pack m)
    True

default hasUndefined :: (Generic a, GHasUndefined (Rep a)) => a -> Bool Source #

ensureSpine :: a -> a Source #

Create a value where at the very least the spine is defined. For example:

    >>> spined = ensureSpine (errorX "?" :: (Int, Int))
    >>> case spined of (_, _) -> 'a'
    'a'
    >>> fmap (const 'b') (ensureSpine undefined :: Vec 3 Int)
    'b' :> 'b' :> 'b' :> Nil
    >>> fmap (const 'c') (ensureSpine undefined :: RTree 2 Int)
    <<'c','c'>,<'c','c'>>

For users familiar with `lazyV`: this is the generalized version of it.

default ensureSpine :: (Generic a, GEnsureSpine (Rep a)) => a -> a Source #

rnfX :: a -> () Source #

Evaluate a value to NF. As opposed to `NFData`s `rnf`, it does not bubble up `XException`s.

default rnfX :: (Generic a, GNFDataX Zero (Rep a)) => a -> () Source #

#### Instances

Instances details

NFDataX RxReg Source # |
Instance details Defined in Clash.Examples.Internal Methods deepErrorX :: String -> RxReg Source # hasUndefined :: RxReg -> Bool Source # ensureSpine :: RxReg -> RxReg Source # rnfX :: RxReg -> () Source #
NFDataX TxReg Source # |
Instance details Defined in Clash.Examples.Internal Methods deepErrorX :: String -> TxReg Source # hasUndefined :: TxReg -> Bool Source # ensureSpine :: TxReg -> TxReg Source # rnfX :: TxReg -> () Source #
NFDataX ClockAB Source # |
Instance details Defined in Clash.Signal.Internal Methods deepErrorX :: String -> ClockAB Source # hasUndefined :: ClockAB -> Bool Source # ensureSpine :: ClockAB -> ClockAB Source # rnfX :: ClockAB -> () Source #
NFDataX Femtoseconds Source # |
Instance details Defined in Clash.Signal.Internal Methods deepErrorX :: String -> Femtoseconds Source # hasUndefined :: Femtoseconds -> Bool Source # ensureSpine :: Femtoseconds -> Femtoseconds Source # rnfX :: Femtoseconds -> () Source #
NFDataX Bit Source # |
Instance details Defined in Clash.Sized.Internal.BitVector Methods deepErrorX :: String -> Bit Source # hasUndefined :: Bit -> Bool Source # ensureSpine :: Bit -> Bit Source # rnfX :: Bit -> () Source #
NFDataX All Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> All Source # hasUndefined :: All -> Bool Source # ensureSpine :: All -> All Source # rnfX :: All -> () Source #
NFDataX Any Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Any Source # hasUndefined :: Any -> Bool Source # ensureSpine :: Any -> Any Source # rnfX :: Any -> () Source #
NFDataX CUShort Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> CUShort Source # hasUndefined :: CUShort -> Bool Source # ensureSpine :: CUShort -> CUShort Source # rnfX :: CUShort -> () Source #
NFDataX Int16 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Int16 Source # hasUndefined :: Int16 -> Bool Source # ensureSpine :: Int16 -> Int16 Source # rnfX :: Int16 -> () Source #
NFDataX Int32 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Int32 Source # hasUndefined :: Int32 -> Bool Source # ensureSpine :: Int32 -> Int32 Source # rnfX :: Int32 -> () Source #
NFDataX Int64 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Int64 Source # hasUndefined :: Int64 -> Bool Source # ensureSpine :: Int64 -> Int64 Source # rnfX :: Int64 -> () Source #
NFDataX Int8 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Int8 Source # hasUndefined :: Int8 -> Bool Source # ensureSpine :: Int8 -> Int8 Source # rnfX :: Int8 -> () Source #
NFDataX Word16 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Word16 Source # hasUndefined :: Word16 -> Bool Source # ensureSpine :: Word16 -> Word16 Source # rnfX :: Word16 -> () Source #
NFDataX Word32 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Word32 Source # hasUndefined :: Word32 -> Bool Source # ensureSpine :: Word32 -> Word32 Source # rnfX :: Word32 -> () Source #
NFDataX Word64 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Word64 Source # hasUndefined :: Word64 -> Bool Source # ensureSpine :: Word64 -> Word64 Source # rnfX :: Word64 -> () Source #
NFDataX Word8 Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Word8 Source # hasUndefined :: Word8 -> Bool Source # ensureSpine :: Word8 -> Word8 Source # rnfX :: Word8 -> () Source #
NFDataX Ordering Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Ordering Source # hasUndefined :: Ordering -> Bool Source # ensureSpine :: Ordering -> Ordering Source # rnfX :: Ordering -> () Source #
NFDataX Half Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Half Source # hasUndefined :: Half -> Bool Source # ensureSpine :: Half -> Half Source # rnfX :: Half -> () Source #
NFDataX Integer Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Integer Source # hasUndefined :: Integer -> Bool Source # ensureSpine :: Integer -> Integer Source # rnfX :: Integer -> () Source #
NFDataX Natural Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Natural Source # hasUndefined :: Natural -> Bool Source # ensureSpine :: Natural -> Natural Source # rnfX :: Natural -> () Source #
NFDataX () Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> () Source # hasUndefined :: () -> Bool Source # ensureSpine :: () -> () Source # rnfX :: () -> () Source #
NFDataX Bool Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Bool Source # hasUndefined :: Bool -> Bool Source # ensureSpine :: Bool -> Bool Source # rnfX :: Bool -> () Source #
NFDataX Char Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Char Source # hasUndefined :: Char -> Bool Source # ensureSpine :: Char -> Char Source # rnfX :: Char -> () Source #
NFDataX Double Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Double Source # hasUndefined :: Double -> Bool Source # ensureSpine :: Double -> Double Source # rnfX :: Double -> () Source #
NFDataX Float Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Float Source # hasUndefined :: Float -> Bool Source # ensureSpine :: Float -> Float Source # rnfX :: Float -> () Source #
NFDataX Int Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Int Source # hasUndefined :: Int -> Bool Source # ensureSpine :: Int -> Int Source # rnfX :: Int -> () Source #
NFDataX Word Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Word Source # hasUndefined :: Word -> Bool Source # ensureSpine :: Word -> Word Source # rnfX :: Word -> () Source #
NFDataX a => NFDataX (Complex a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Complex a Source # hasUndefined :: Complex a -> Bool Source # ensureSpine :: Complex a -> Complex a Source # rnfX :: Complex a -> () Source #
NFDataX a => NFDataX (First a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> First a Source # hasUndefined :: First a -> Bool Source # ensureSpine :: First a -> First a Source # rnfX :: First a -> () Source #
NFDataX a => NFDataX (Last a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Last a Source # hasUndefined :: Last a -> Bool Source # ensureSpine :: Last a -> Last a Source # rnfX :: Last a -> () Source #
NFDataX a => NFDataX (Max a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Max a Source # hasUndefined :: Max a -> Bool Source # ensureSpine :: Max a -> Max a Source # rnfX :: Max a -> () Source #
NFDataX a => NFDataX (Min a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Min a Source # hasUndefined :: Min a -> Bool Source # ensureSpine :: Min a -> Min a Source # rnfX :: Min a -> () Source #
NFDataX a => NFDataX (SimOnly a) Source # |
Instance details Defined in Clash.Magic Methods deepErrorX :: String -> SimOnly a Source # hasUndefined :: SimOnly a -> Bool Source # ensureSpine :: SimOnly a -> SimOnly a Source # rnfX :: SimOnly a -> () Source #
NFDataX a => NFDataX (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods deepErrorX :: String -> Erroring a Source # hasUndefined :: Erroring a -> Bool Source # ensureSpine :: Erroring a -> Erroring a Source # rnfX :: Erroring a -> () Source #
NFDataX a => NFDataX (Overflowing a) Source # |
Instance details Defined in Clash.Num.Overflowing Methods deepErrorX :: String -> Overflowing a Source # hasUndefined :: Overflowing a -> Bool Source # ensureSpine :: Overflowing a -> Overflowing a Source # rnfX :: Overflowing a -> () Source #
NFDataX a => NFDataX (Saturating a) Source # |
Instance details Defined in Clash.Num.Saturating Methods deepErrorX :: String -> Saturating a Source # hasUndefined :: Saturating a -> Bool Source # ensureSpine :: Saturating a -> Saturating a Source # rnfX :: Saturating a -> () Source #
NFDataX a => NFDataX (Wrapping a) Source # |
Instance details Defined in Clash.Num.Wrapping Methods deepErrorX :: String -> Wrapping a Source # hasUndefined :: Wrapping a -> Bool Source # ensureSpine :: Wrapping a -> Wrapping a Source # rnfX :: Wrapping a -> () Source #
NFDataX a => NFDataX (Zeroing a) Source # |
Instance details Defined in Clash.Num.Zeroing Methods deepErrorX :: String -> Zeroing a Source # hasUndefined :: Zeroing a -> Bool Source # ensureSpine :: Zeroing a -> Zeroing a Source # rnfX :: Zeroing a -> () Source #
KnownNat n => NFDataX (BitVector n) Source # |
Instance details Defined in Clash.Sized.Internal.BitVector Methods deepErrorX :: String -> BitVector n Source # hasUndefined :: BitVector n -> Bool Source # ensureSpine :: BitVector n -> BitVector n Source # rnfX :: BitVector n -> () Source #
NFDataX (Index n) Source # |
Instance details Defined in Clash.Sized.Internal.Index Methods deepErrorX :: String -> Index n Source # hasUndefined :: Index n -> Bool Source # ensureSpine :: Index n -> Index n Source # rnfX :: Index n -> () Source #
NFDataX (Signed n) Source # |
Instance details Defined in Clash.Sized.Internal.Signed Methods deepErrorX :: String -> Signed n Source # hasUndefined :: Signed n -> Bool Source # ensureSpine :: Signed n -> Signed n Source # rnfX :: Signed n -> () Source #
NFDataX (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods deepErrorX :: String -> Unsigned n Source # hasUndefined :: Unsigned n -> Bool Source # ensureSpine :: Unsigned n -> Unsigned n Source # rnfX :: Unsigned n -> () Source #
NFDataX a => NFDataX (Seq a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Seq a Source # hasUndefined :: Seq a -> Bool Source # ensureSpine :: Seq a -> Seq a Source # rnfX :: Seq a -> () Source #
NFDataX a => NFDataX (NonEmpty a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> NonEmpty a Source # hasUndefined :: NonEmpty a -> Bool Source # ensureSpine :: NonEmpty a -> NonEmpty a Source # rnfX :: NonEmpty a -> () Source #
NFDataX a => NFDataX (Identity a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Identity a Source # hasUndefined :: Identity a -> Bool Source # ensureSpine :: Identity a -> Identity a Source # rnfX :: Identity a -> () Source #
NFDataX a => NFDataX (First a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> First a Source # hasUndefined :: First a -> Bool Source # ensureSpine :: First a -> First a Source # rnfX :: First a -> () Source #
NFDataX a => NFDataX (Last a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Last a Source # hasUndefined :: Last a -> Bool Source # ensureSpine :: Last a -> Last a Source # rnfX :: Last a -> () Source #
NFDataX a => NFDataX (Down a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Down a Source # hasUndefined :: Down a -> Bool Source # ensureSpine :: Down a -> Down a Source # rnfX :: Down a -> () Source #
NFDataX a => NFDataX (Dual a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Dual a Source # hasUndefined :: Dual a -> Bool Source # ensureSpine :: Dual a -> Dual a Source # rnfX :: Dual a -> () Source #
NFDataX a => NFDataX (Endo a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Endo a Source # hasUndefined :: Endo a -> Bool Source # ensureSpine :: Endo a -> Endo a Source # rnfX :: Endo a -> () Source #
NFDataX a => NFDataX (Product a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Product a Source # hasUndefined :: Product a -> Bool Source # ensureSpine :: Product a -> Product a Source # rnfX :: Product a -> () Source #
NFDataX a => NFDataX (Sum a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Sum a Source # hasUndefined :: Sum a -> Bool Source # ensureSpine :: Sum a -> Sum a Source # rnfX :: Sum a -> () Source #
NFDataX a => NFDataX (Ratio a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Ratio a Source # hasUndefined :: Ratio a -> Bool Source # ensureSpine :: Ratio a -> Ratio a Source # rnfX :: Ratio a -> () Source #
NFDataX a => NFDataX (Infinite a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Infinite a Source # hasUndefined :: Infinite a -> Bool Source # ensureSpine :: Infinite a -> Infinite a Source # rnfX :: Infinite a -> () Source #
NFDataX a => NFDataX (Maybe a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Maybe a Source # hasUndefined :: Maybe a -> Bool Source # ensureSpine :: Maybe a -> Maybe a Source # rnfX :: Maybe a -> () Source #
NFDataX a => NFDataX [a] Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> [a] Source # hasUndefined :: [a] -> Bool Source # ensureSpine :: [a] -> [a] Source # rnfX :: [a] -> () Source #
(NFDataX a, NFDataX b) => NFDataX (Arg a b) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Arg a b Source # hasUndefined :: Arg a b -> Bool Source # ensureSpine :: Arg a b -> Arg a b Source # rnfX :: Arg a b -> () Source #
NFDataX a => NFDataX (RamOp n a) Source # |
Instance details Defined in Clash.Explicit.BlockRam Methods deepErrorX :: String -> RamOp n a Source # hasUndefined :: RamOp n a -> Bool Source # ensureSpine :: RamOp n a -> RamOp n a Source # rnfX :: RamOp n a -> () Source #
NFDataX a => NFDataX (Signal domain a) Source # |
Instance details Defined in Clash.Signal.Internal Methods deepErrorX :: String -> Signal domain a Source # hasUndefined :: Signal domain a -> Bool Source # ensureSpine :: Signal domain a -> Signal domain a Source # rnfX :: Signal domain a -> () Source #
(KnownNat d, NFDataX a) => NFDataX (RTree d a) Source # |
Instance details Defined in Clash.Sized.RTree Methods deepErrorX :: String -> RTree d a Source # hasUndefined :: RTree d a -> Bool Source # ensureSpine :: RTree d a -> RTree d a Source # rnfX :: RTree d a -> () Source #
(NFDataX a, KnownNat n) => NFDataX (Vec n a) Source # |
Instance details Defined in Clash.Sized.Vector Methods deepErrorX :: String -> Vec n a Source # hasUndefined :: Vec n a -> Bool Source # ensureSpine :: Vec n a -> Vec n a Source # rnfX :: Vec n a -> () Source #
(NFDataX a, NFDataX b) => NFDataX (Either a b) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Either a b Source # hasUndefined :: Either a b -> Bool Source # ensureSpine :: Either a b -> Either a b Source # rnfX :: Either a b -> () Source #
NFDataX (Proxy a) Source # | Since: 1.8.2
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Proxy a Source # hasUndefined :: Proxy a -> Bool Source # ensureSpine :: Proxy a -> Proxy a Source # rnfX :: Proxy a -> () Source #
(NFDataX a0, NFDataX a1) => NFDataX (a0, a1) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1) Source # hasUndefined :: (a0, a1) -> Bool Source # ensureSpine :: (a0, a1) -> (a0, a1) Source # rnfX :: (a0, a1) -> () Source #
NFDataX b => NFDataX (a -> b) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> a -> b Source # hasUndefined :: (a -> b) -> Bool Source # ensureSpine :: (a -> b) -> a -> b Source # rnfX :: (a -> b) -> () Source #
NFDataX (rep (int + frac)) => NFDataX (Fixed rep int frac) Source # |
Instance details Defined in Clash.Sized.Fixed Methods deepErrorX :: String -> Fixed rep int frac Source # hasUndefined :: Fixed rep int frac -> Bool Source # ensureSpine :: Fixed rep int frac -> Fixed rep int frac Source # rnfX :: Fixed rep int frac -> () Source #
NFDataX a => NFDataX (Const a b) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Const a b Source # hasUndefined :: Const a b -> Bool Source # ensureSpine :: Const a b -> Const a b Source # rnfX :: Const a b -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2) => NFDataX (a0, a1, a2) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2) Source # hasUndefined :: (a0, a1, a2) -> Bool Source # ensureSpine :: (a0, a1, a2) -> (a0, a1, a2) Source # rnfX :: (a0, a1, a2) -> () Source #
(NFDataX (f a), NFDataX (g a)) => NFDataX (Product f g a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Product f g a Source # hasUndefined :: Product f g a -> Bool Source # ensureSpine :: Product f g a -> Product f g a Source # rnfX :: Product f g a -> () Source #
(NFDataX (f a), NFDataX (g a)) => NFDataX (Sum f g a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Sum f g a Source # hasUndefined :: Sum f g a -> Bool Source # ensureSpine :: Sum f g a -> Sum f g a Source # rnfX :: Sum f g a -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3) => NFDataX (a0, a1, a2, a3) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3) Source # hasUndefined :: (a0, a1, a2, a3) -> Bool Source # ensureSpine :: (a0, a1, a2, a3) -> (a0, a1, a2, a3) Source # rnfX :: (a0, a1, a2, a3) -> () Source #
NFDataX (f (g a)) => NFDataX (Compose f g a) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> Compose f g a Source # hasUndefined :: Compose f g a -> Bool Source # ensureSpine :: Compose f g a -> Compose f g a Source # rnfX :: Compose f g a -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4) => NFDataX (a0, a1, a2, a3, a4) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4) Source # hasUndefined :: (a0, a1, a2, a3, a4) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4) -> (a0, a1, a2, a3, a4) Source # rnfX :: (a0, a1, a2, a3, a4) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5) => NFDataX (a0, a1, a2, a3, a4, a5) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5) -> (a0, a1, a2, a3, a4, a5) Source # rnfX :: (a0, a1, a2, a3, a4, a5) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6) => NFDataX (a0, a1, a2, a3, a4, a5, a6) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5, a6) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5, a6) -> (a0, a1, a2, a3, a4, a5, a6) Source # rnfX :: (a0, a1, a2, a3, a4, a5, a6) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6, NFDataX a7) => NFDataX (a0, a1, a2, a3, a4, a5, a6, a7) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6, a7) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5, a6, a7) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5, a6, a7) -> (a0, a1, a2, a3, a4, a5, a6, a7) Source # rnfX :: (a0, a1, a2, a3, a4, a5, a6, a7) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6, NFDataX a7, NFDataX a8) => NFDataX (a0, a1, a2, a3, a4, a5, a6, a7, a8) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6, a7, a8) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5, a6, a7, a8) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5, a6, a7, a8) -> (a0, a1, a2, a3, a4, a5, a6, a7, a8) Source # rnfX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6, NFDataX a7, NFDataX a8, NFDataX a9) => NFDataX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # rnfX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> () Source #
(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6, NFDataX a7, NFDataX a8, NFDataX a9, NFDataX a10) => NFDataX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # |
Instance details Defined in Clash.XException Methods deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # hasUndefined :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> Bool Source # ensureSpine :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # rnfX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> () Source #

(NFDataX a0, NFDataX a1, NFDataX a2, NFDataX a3, NFDataX a4, NFDataX a5, NFDataX a6, NFDataX a7, NFDataX a8, NFDataX a9, NFDataX a10, NFDataX a11) => NFDataX (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

NB: The documentation only shows instances up to 3-tuples. By default, instances up to and including 12-tuples will exist. If the flag `large-tuples` is set instances up to the GHC imposed limit will exist. The GHC imposed limit is either 62 or 64 depending on the GHC version.

Instance details

Defined in Clash.XException

Methods

deepErrorX :: String -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

hasUndefined :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> Bool Source #

ensureSpine :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

rnfX :: (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> () Source #