pi package:clash-prelude

Determine whether a write enable is active
"dropI xs" returns the suffix of xs as demanded by the context.
>>> dropI (1:>2:>3:>4:>5:>Nil) :: Vec 2 Int
4 :> 5 :> Nil
Same as implies but strictly temporal.
Same as error but will make HDL generation fail if included in the final circuit. This is useful for the error case of static assertions. Note that the error message needs to be a literal, and during HDL generation the error message does not include a stack trace, so it had better be descriptive.
A wrapping number type is one where all operations wrap between minBound and maxBound (and vice-versa) if the result goes out of bounds for the underlying type. Numbers can be converted to wrap by default using toWrapping.
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.
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.