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 |
|
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
=id
unbundle
.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
bundle :: Unbundled domain a -> Signal domain a Source #
Example:
bundle :: (Signal
domain a,Signal
domain b) ->Signal
clk (a,b)
However:
bundle ::Signal
domainBit
->Signal
domainBit
bundle :: Signal domain a ~ Unbundled domain a => Unbundled domain a -> Signal domain a Source #
Example:
bundle :: (Signal
domain a,Signal
domain b) ->Signal
clk (a,b)
However:
bundle ::Signal
domainBit
->Signal
domainBit
unbundle :: Signal domain a -> Unbundled domain a Source #
Example:
unbundle ::Signal
domain (a,b) -> (Signal
domain a,Signal
domain b)
However:
unbundle ::Signal
domainBit
->Signal
domainBit
unbundle :: Unbundled domain a ~ Signal domain a => Signal domain a -> Unbundled domain a Source #
Instances
Bundle Bool Source # | |
Bundle Double Source # | |
Bundle Float Source # | |
Bundle Int Source # | |
Bundle Integer Source # | |
Bundle () Source # | Note that: bundle :: () -> Signal domain () unbundle :: Signal domain () -> () |
Bundle Bit Source # | |
Bundle (Maybe a) Source # | |
Bundle (BitVector n) Source # | |
Bundle (Index n) Source # | |
Bundle (Unsigned n) Source # | |
Bundle (Signed n) Source # | |
Bundle (Either a b) Source # | |
Bundle (a, b) Source # | |
KnownNat n => Bundle (Vec n a) Source # | |
KnownNat d => Bundle (RTree d a) Source # | |
Bundle (a, b, c) Source # | |
Bundle (Fixed rep int frac) Source # | |
Bundle (a, b, c, d) Source # | |
Bundle (a, b, c, d, e) Source # | |
Bundle (a, b, c, d, e, f) Source # | |
Bundle (a, b, c, d, e, f, g) Source # | |
Bundle (a, b, c, d, e, f, g, h) Source # | |
Defined in Clash.Signal.Bundle |