circus-0.1.0.0: Types and a small DSL for working with netlistsvg
Safe HaskellNone
LanguageHaskell2010

Circus.DSL

Synopsis

Documentation

data GraphState Source #

Constructors

GraphState 

Instances

Instances details
Generic GraphState Source # 
Instance details

Defined in Circus.DSL

Associated Types

type Rep GraphState :: Type -> Type #

Semigroup GraphState Source # 
Instance details

Defined in Circus.DSL

Monoid GraphState Source # 
Instance details

Defined in Circus.DSL

type Rep GraphState Source # 
Instance details

Defined in Circus.DSL

type Rep GraphState = D1 ('MetaData "GraphState" "Circus.DSL" "circus-0.1.0.0-7gwvoNsbnBR3ebwlAtgx3C" 'False) (C1 ('MetaCons "GraphState" 'PrefixI 'True) (S1 ('MetaSel ('Just "gs_next_port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bit) :*: S1 ('MetaSel ('Just "gs_module") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Module)))

freshBit :: MonadState GraphState m => m Bit Source #

Synthesize a fresh Bit, suitable for connecting Cells together.

addCell :: MonadState GraphState m => Cell -> m () Source #

Add a Cell to the Module under construction.

unifyBitsPure :: Data a => Map Bit Bit -> a -> a Source #

Like unifyBits, but works in pure contexts.

unifyBits :: MonadState GraphState m => Map Bit Bit -> m () Source #

Given a mapping from source Bits to target Bits, replace all occurences of the source bits in the Module with the target bits.

This function allows you to call addCell as you go, and create feedback loops later without needing to know about them in advance.