Copyright | (C) 2019 Myrtle Software Ltd. 2018 @blaxill 2018 QBayLogic B.V. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Bundle a where
- data EmptyTuple = EmptyTuple
- data TaggedEmptyTuple (dom :: Domain) (d :: Nat) = TaggedEmptyTuple
Documentation
Isomorphism between a DSignal
of a product type
(e.g. a tuple) and a product type of DSignal
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
dom delay D =DSignal
dom delay Dbundle
s = sunbundle
s = s
Nothing
bundle :: Unbundled dom d a -> DSignal dom d a Source #
Example:
bundle :: (DSignal
dom d a,DSignal
dom d b) ->DSignal
clk d (a,b)
However:
bundle ::DSignal
domBit
->DSignal
domBit
bundle :: DSignal dom d a ~ Unbundled dom d a => Unbundled dom d a -> DSignal dom d a Source #
Example:
bundle :: (DSignal
dom d a,DSignal
dom d b) ->DSignal
clk d (a,b)
However:
bundle ::DSignal
domBit
->DSignal
domBit
unbundle :: DSignal dom d a -> Unbundled dom d a Source #
Example:
unbundle ::DSignal
dom d (a,b) -> (DSignal
dom d a,DSignal
dom d b)
However:
unbundle ::DSignal
domBit
->DSignal
domBit
unbundle :: Unbundled dom d a ~ DSignal dom d a => DSignal dom d a -> Unbundled dom d a Source #
Instances
Tools to emulate pre Clash 1.0 Bundle ()
instance
data EmptyTuple Source #
See TaggedEmptyTuple
Instances
Bundle EmptyTuple Source # | See https://github.com/clash-lang/clash-compiler/pull/539/commits/94b0bff5770aa4961e04ddce2515130df3fc7863 and documentation for TaggedEmptyTuple. |
Defined in Clash.Signal.Bundle type Unbundled dom EmptyTuple = (res :: Type) Source # bundle :: Unbundled dom EmptyTuple -> Signal dom EmptyTuple Source # unbundle :: Signal dom EmptyTuple -> Unbundled dom EmptyTuple Source # | |
Bundle EmptyTuple Source # | See https://github.com/clash-lang/clash-compiler/pull/539/commits/94b0bff5770aa4961e04ddce2515130df3fc7863 and documentation for TaggedEmptyTuple. |
Defined in Clash.Signal.Delayed.Bundle type Unbundled dom d EmptyTuple = (res :: Type) Source # bundle :: Unbundled dom d EmptyTuple -> DSignal dom d EmptyTuple Source # unbundle :: DSignal dom d EmptyTuple -> Unbundled dom d EmptyTuple Source # | |
type Unbundled dom EmptyTuple Source # | |
Defined in Clash.Signal.Bundle | |
type Unbundled dom d EmptyTuple Source # | |
Defined in Clash.Signal.Delayed.Bundle |
data TaggedEmptyTuple (dom :: Domain) (d :: Nat) Source #
Same as Clash.Signal.Bundle.TaggedEmptyTuple, but adapted for DSignal.