Arg package:clash-lib
An argument applied to a function data constructor primitive.
Like Arg, but its first argument is the scoping level. For use in in
generated code only.
Push cast over an argument to a function into that function
This is done by specializing on the casted argument. Example: y =
f (cast a) where f x = g x transforms to: y = f' a where f'
x' = (\x -> g x) (cast x')
The reason d'etre for this transformation is that we hope to end up
with and expression where two casts are "back-to-back" after which we
can eliminate them in eliminateCastCast.
Get the result type of a polymorphic function given a list of
arguments
Argument position of an application. If this is an argument applied to
a primitive, a tuple is defined containing (name of the primitive,
#type args, #term args)
Split a (Type)Application in the applied term and it arguments
Given a function application, find the primitive it's applied. Yields
Nothing if given term is not an application or if it is not a
primitive.
Given a DataCon and a list of types, the type variables of the DataCon
type are substituted for the list of types. The argument types are
returned.
The list of types should be equal to the number of type variables,
otherwise Nothing is returned.
Same as dataConInstArgTys, but it tries to compute
existentials too, hence the extra argument TyConMap. WARNING:
It will return the types of non-existentials only
Collect arguments (e.g., ~ARG, ~LIT) used in this blackbox
The removedArg primitive represents an argument which is
computationally irrelevant, and has been removed from the circuit (as
removing it does not change the behaviour of the circuit). Examples of
such arguments are unused arguments to blackboxes, as removing them
does not affect the rendered HDL.
The separating arguments transformation
Split apart (global) function arguments that contain types that we
want to separate off, e.g. Clocks. Works on both the definition side
(i.e. the lambda), and the call site (i.e. the application of the
global variable). e.g. turns
f :: (Clock System, Reset System) -> Signal System Int
into
f :: Clock System -> Reset System -> Signal System Int
Cache for looking up constantness of blackbox arguments