| Copyright | (C) 2013-2016 University of Twente 2017 Myrtle Software Ltd Google Inc. |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
| Extensions |
|
Clash.Signal.Bundle
Description
The Product/Signal isomorphism
Documentation
Isomorphism between a Signal of a product type (e.g. a tuple) and a
product type of Signal's.
Instances of Bundle must satisfy the following laws:
bundle.unbundle=idunbundle.bundle=id
By default, bundle and unbundle, are defined as the identity, that is,
writing:
data D = A | B instance Bundle D
is the same as:
data D = A | B instance Bundle D where typeUnbundled'clk D =Signal'clk Dbundle_ s = sunbundle_ s = s
Methods
bundle :: Unbundled domain a -> Signal domain a #
Example:
bundle :: (Signaldomain a,Signaldomain b) ->Signalclk (a,b)
However:
bundle ::SignaldomainBit->SignaldomainBit
bundle :: Signal domain a ~ Unbundled domain a => Unbundled domain a -> Signal domain a #
Example:
bundle :: (Signaldomain a,Signaldomain b) ->Signalclk (a,b)
However:
bundle ::SignaldomainBit->SignaldomainBit
unbundle :: Signal domain a -> Unbundled domain a #
Example:
unbundle ::Signaldomain (a,b) -> (Signaldomain a,Signaldomain b)
However:
unbundle ::SignaldomainBit->SignaldomainBit
unbundle :: Unbundled domain a ~ Signal domain a => Signal domain a -> Unbundled domain a #
Instances
| Bundle Bool # | |
| Bundle Double # | |
| Bundle Float # | |
| Bundle Int # | |
| Bundle Integer # | |
| Bundle () # | Note that: bundle :: () -> Signal domain () unbundle :: Signal domain () -> () |
| Bundle Bit # | |
| Bundle (Maybe a) # | |
| Bundle (BitVector n) # | |
| Bundle (Index n) # | |
| Bundle (Unsigned n) # | |
| Bundle (Signed n) # | |
| Bundle (Either a b) # | |
| Bundle (a, b) # | |
| KnownNat n => Bundle (Vec n a) # | |
| KnownNat d => Bundle (RTree d a) # | |
| Bundle (a, b, c) # | |
| Bundle (Fixed rep int frac) # | |
| Bundle (a, b, c, d) # | |
| Bundle (a, b, c, d, e) # | |
| Bundle (a, b, c, d, e, f) # | |
| Bundle (a, b, c, d, e, f, g) # | |
| Bundle (a, b, c, d, e, f, g, h) # | |
Defined in Clash.Signal.Bundle | |