feldspar-compiler-0.7: Compiler for the Feldspar language

Safe HaskellNone
LanguageHaskell2010

Feldspar.Compiler.Plugin

Description

Dynamically load a compiled Feldspar function as a Haskell function

Synopsis

Documentation

loadFun :: [Name] -> Q [Dec] Source

Compile and load Feldspar functions into the current GHC session.

prog1 :: Data Index -> Vector1 Index
prog1 c = indexed c (const c)

$(loadFun ['prog1])

The call to loadFun above will splice code into the current module to compile, load and wrap a Feldspar function as a Haskell function:

c_prog1 :: Index -> [Index]

loadFunOpts :: [String] -> [Name] -> Q [Dec] Source

Call loadFun with C compiler options

loadFunWithConfig :: Config -> [Name] -> Q [Dec]

Generic function compiler and loader

pack :: (Reference (Rep a), Marshal a) => a -> IO (Ref (Rep a))

Pack a value into its runtime representation

pack a = to a >>= ref

unpack :: (Reference (Rep a), Marshal a) => Ref (Rep a) -> IO a

Unpack a value from its runtime representation

unpack a = deref a >>= from