synthesizer-llvm-0.8.1.1: Efficient signal processing using runtime compilation

Safe HaskellNone
LanguageHaskell98

Synthesizer.LLVM.CausalParameterized.Functional

Synopsis

Documentation

data T p inp out Source

Instances

Functor (T p inp) Source 
Applicative (T p inp) Source 
(Field b, Real b, RationalConstant b) => Fractional (T p a b) Source 
(PseudoRing b, Real b, IntegerConstant b) => Num (T p a b) Source 
(Transcendental b, RationalConstant b) => C (T p a b) Source 
(Transcendental b, RationalConstant b) => C (T p a b) Source 
(Field b, RationalConstant b) => C (T p a b) Source 
(PseudoRing b, IntegerConstant b) => C (T p a b) Source 
Additive b => C (T p a b) Source 

lift :: T p inp out -> T p inp out Source

fromSignal :: T p out -> T p inp out Source

($&) :: T p b c -> T p a b -> T p a c infixr 0 Source

(&|&) :: T p a b -> T p a c -> T p a (b, c) infixr 3 Source

compile :: T p inp out -> T p inp out Source

compileSignal :: T p () out -> T p out Source

withArgs :: MakeArguments inp => (Arguments (T p inp) inp -> T p inp out) -> T p inp out Source

Using withArgs you can simplify

let x = F.lift (arr fst)
    y = F.lift (arr (fst.snd))
    z = F.lift (arr (snd.snd))
in  F.compile (f x y z)

to

withArgs $ \(x,(y,z)) -> f x y z

type family Arguments f arg Source

Instances

type Arguments f () = f () Source 
type Arguments f (AnyArg a) = f a Source 
type Arguments f (T v) = f (T v) Source 
type Arguments f (T a) = T (Arguments f a) Source

Consistent with pair instance. You may use AnyArg or withGuidedArgs to stop descending into the stereo channels.

type Arguments f (Value a) = f (Value a) Source 
type Arguments f (ParameterPacked a) = f (ParameterPacked a) Source 
type Arguments f (T a) = f (T a) Source 
type Arguments f (a, b) = (Arguments f a, Arguments f b) Source 
type Arguments f (Value n a) = f (Value n a) Source 
type Arguments f (CascadeParameter n a) = f (CascadeParameter n a) Source 
type Arguments f (ParameterValue n a) = f (ParameterValue n a) Source 
type Arguments f (a, b, c) = (Arguments f a, Arguments f b, Arguments f c) Source 

newtype AnyArg a Source

You can use this to explicitly stop breaking of composed data types. It might be more comfortable to do this using withGuidedArgs.

Constructors

AnyArg 

Fields

getAnyArg :: a
 

Instances

data Atom a Source

Constructors

Atom 

Instances

withGuidedArgs :: (MakeGuidedArguments pat, PatternArguments pat ~ inp) => pat -> (GuidedArguments (T p inp) pat -> T p inp out) -> T p inp out Source

This is similar to withArgs but it allows to specify the decomposition depth using a pattern.

type family GuidedArguments f pat Source

Instances

type GuidedArguments f () = f () Source 
type GuidedArguments f (T a) = T (GuidedArguments f a) Source 
type GuidedArguments f (Atom a) = f a Source 
type GuidedArguments f (a, b) = (GuidedArguments f a, GuidedArguments f b) Source 
type GuidedArguments f (a, b, c) = (GuidedArguments f a, GuidedArguments f b, GuidedArguments f c) Source 

data PrepareArguments f merged separated Source

withPreparedArgs :: PrepareArguments (T p inp) inp a -> (a -> T p inp out) -> T p inp out Source

Alternative to withGuidedArgs. This way of pattern construction is even Haskell 98.

withPreparedArgs2 :: PrepareArguments (T p (inp0, inp1)) inp0 a -> PrepareArguments (T p (inp0, inp1)) inp1 b -> (a -> b -> T p (inp0, inp1) out) -> T p (inp0, inp1) out Source

pairArgs :: Functor f => PrepareArguments f a0 b0 -> PrepareArguments f a1 b1 -> PrepareArguments f (a0, a1) (b0, b1) Source

tripleArgs :: Functor f => PrepareArguments f a0 b0 -> PrepareArguments f a1 b1 -> PrepareArguments f a2 b2 -> PrepareArguments f (a0, a1, a2) (b0, b1, b2) Source