synthesizer-llvm-0.7.0.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) 
Applicative (T p inp) 
(Field b, Real b, RationalConstant b) => Fractional (T p a b) 
(PseudoRing b, Real b, IntegerConstant b) => Num (T p a b) 
(Transcendental b, RationalConstant b) => C (T p a b) 
(Transcendental b, RationalConstant b) => C (T p a b) 
(Field b, RationalConstant b) => C (T p a b) 
(PseudoRing b, IntegerConstant b) => C (T p a b) 
Additive b => C (T p a b) 

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 () 
type Arguments f (AnyArg a) = f a 
type Arguments f (T v) = f (T v) 
type Arguments f (T a) = T (Arguments f a)

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) 
type Arguments f (T a) = f (T a) 
type Arguments f (ParameterPacked a) = f (ParameterPacked a) 
type Arguments f (a, b) = (Arguments f a, Arguments f b) 
type Arguments f (Value n a) = f (Value n a) 
type Arguments f (CascadeParameter n a) = f (CascadeParameter n a) 
type Arguments f (ParameterValue n a) = f (ParameterValue n a) 
type Arguments f (a, b, c) = (Arguments f a, Arguments f b, Arguments f c) 

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

MakeArguments (AnyArg a) 
type Arguments f (AnyArg a) = f a 

data Atom a Source

Constructors

Atom 

Instances

MakeGuidedArguments (Atom a) 
type GuidedArguments f (Atom a) = f a 
type PatternArguments (Atom a) = a 

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 () 
type GuidedArguments f (T a) = T (GuidedArguments f a) 
type GuidedArguments f (Atom a) = f a 
type GuidedArguments f (a, b) = (GuidedArguments f a, GuidedArguments f b) 
type GuidedArguments f (a, b, c) = (GuidedArguments f a, GuidedArguments f b, GuidedArguments f c)