feldspar-language-0.3.3: A functional embedded language for DSP and parallelism

Feldspar.Core.Reify

Description

Functions for reifying expressions (Data / Expr) to graphs (Graph) and to textual format.

Synopsis

Documentation

class Program a whereSource

Types that represent core language programs

Methods

reify :: a -> GraphSource

Converts a program to a Graph

numArgs :: T a -> IntSource

Returns whether or not the program has an argument. This is needed because the Graph type always assumes the existence of an input. So for programs without input, the Graph representation will have a "dummy" input, which is indistinguishable from a real input.

Instances

Computable a => Program a 
(Computable a, Computable b, Computable c, Computable d, Computable e) => Program (a -> b -> c -> d -> e) 
(Computable a, Computable b, Computable c, Computable d) => Program (a -> b -> c -> d) 
(Computable a, Computable b, Computable c) => Program (a -> b -> c) 
(Computable a, Computable b) => Program (a -> b) 
(Computable a, Computable b) => Program (a, b) 
(Computable a, Computable b, Computable c) => Program (a, b, c) 
(Computable a, Computable b, Computable c, Computable d) => Program (a, b, c, d) 

showCore :: forall a. Program a => a -> StringSource

Shows the core code generated by the program.

showCoreWithSize :: forall a. Program a => a -> StringSource

Shows the core code with size information as comments.

printCore :: Program a => a -> IO ()Source

printCore = putStrLn . showCore

printCoreWithSize :: Program a => a -> IO ()Source

printCoreWithSize = putStrLn . showCoreWithSize

runGraph :: Reify a -> Info -> (a, ([Node], Info))Source

buildSubFun :: forall a b. (Typeable a, Typeable b) => (a :-> b) -> Reify InterfaceSource