clash-prelude-1.6.6: Clash: a functional hardware description language - Prelude library
Safe HaskellNone
LanguageHaskell2010

Clash.Class.HasDomain

Synopsis

Documentation

type WithSpecificDomain dom r = (HasSpecificDomain dom r, dom ~ GetDomain dom r) Source #

Type that forces dom to be present in r at least once. Will resolve to a type error if it doesn't. It will always fail if given dom is completely polymorphic and can't be tied to r in any way.

type WithSingleDomain dom r = (HasSingleDomain r, dom ~ GetDomain r) Source #

Type that forces dom to be the same in all subtypes of r that might contain a domain. If given a polymorphic domain not tied to r, GHC will be allowed to infer that that domain is equal to the one in r on the condition that r contains just a single domain.

type family HasDomain (dom :: Domain) (n :: Type) :: HasDomainWrapperResult Source #

Type family that searches a type and checks whether a specific domain is present. Will result in either "domain not found, and no others either", "domain not found, but found another", or "found domain".

Instances

Instances details
type HasDomain dom1 (Enable dom2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (Enable dom2) = DomEq dom1 dom2
type HasDomain dom1 (Reset dom2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (Reset dom2) = DomEq dom1 dom2
type HasDomain dom1 (Clock dom2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (Clock dom2) = DomEq dom1 dom2
type HasDomain dom (Vec n a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom (Vec n a) = HasDomain dom a
type HasDomain dom1 (Signal dom2 a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (Signal dom2 a) = DomEq dom1 dom2
type HasDomain dom1 (Proxy dom2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (Proxy dom2) = DomEq dom1 dom2
type HasDomain dom (a -> b) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom (a -> b) = Merge dom a b
type HasDomain dom (a, b) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom (a, b) = Merge dom a b
type HasDomain dom1 (DSignal dom2 delay a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom1 (DSignal dom2 delay a) = DomEq dom1 dom2
type HasDomain dom (a0, a1, a2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSpecificDomain

type HasDomain dom (a0, a1, a2) = Merge dom a0 (a1, a2)
type HasDomain dom1 (BiSignalOut ds dom2 n) Source # 
Instance details

Defined in Clash.Signal.BiSignal

type HasDomain dom1 (BiSignalOut ds dom2 n) = DomEq dom1 dom2

type family TryDomain (orig :: Type) (n :: Type) :: TryDomainResult Source #

Instances

Instances details
type TryDomain t Double Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t Float Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t Int Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t Natural Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t Integer Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t Bool Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t () Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t () = 'NotFound
type TryDomain t Bit Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Maybe a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Maybe a) = TryDomain t a
type TryDomain t (BitVector n) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Signed n) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Signed n) = 'NotFound
type TryDomain t (Unsigned n) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Index n) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Index n) = 'NotFound
type TryDomain t (Enable dom) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Enable dom) = 'Found dom
type TryDomain t (Reset dom) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Reset dom) = 'Found dom
type TryDomain t (Clock dom) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Clock dom) = 'Found dom
type TryDomain t (RTree d a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (RTree d a) = TryDomain t a
type TryDomain t (Vec n a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Vec n a) = TryDomain t a
type TryDomain t (Proxy dom) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Proxy dom) = 'Found dom
type TryDomain t (Signal dom a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Signal dom a) = 'Found dom
type TryDomain t (Either a b) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Either a b) = Merge t a b
type TryDomain t (a, b) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (a, b) = Merge t a b
type TryDomain t (a -> b) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (a -> b) = Merge t a b
type TryDomain t (Fixed a n m) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (Fixed a n m) = TryDomain t (a (n + m))
type TryDomain t (DSignal dom delay a) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (DSignal dom delay a) = 'Found dom
type TryDomain t (a0, a1, a2) Source # 
Instance details

Defined in Clash.Class.HasDomain.HasSingleDomain

type TryDomain t (a0, a1, a2) = Merge t a0 (a1, a2)
type TryDomain t (BiSignalOut ds dom n) Source # 
Instance details

Defined in Clash.Signal.BiSignal

type TryDomain t (BiSignalOut ds dom n) = 'Found dom

type DomEq (n :: Domain) (m :: Domain) = IfStuck (DomEqWorker n m) 'NotFound (Pure (DomEqWorker n m)) Source #

Check domain for equality. Return 'Found if so, return 'NotFound if not. The reason d'etre for this type family is that _open_ type families don't allow overlapping types. We therefore defer equality checking to a closed type family.