inline-r-0.9.1: Seamlessly call R from Haskell and vice versa. No FFI required.

Copyright(C) 2013 Amgen Inc.
Safe HaskellNone
LanguageHaskell2010

Language.R.Internal.FunWrappers.TH

Description

 

Synopsis

Documentation

thWrappers :: Int -> Int -> Q [Dec] Source #

Generate wrappers from n to m.

thWrapper :: Int -> Q Dec Source #

Generate wrapper.

Example for input 5:

foreign import ccall "wrapper" wrap5
   :: (  SEXP a -> SEXP b -> SEXP c
      -> SEXP d -> SEXP e -> IO (SEXP f)
      )
   -> IO (FunPtr (  SEXP a -> SEXP b -> SEXP c
                 -> SEXP d -> SEXP e -> IO (SEXP f)
                 )
         )

thWrapperLiteral :: Int -> Q Dec Source #

Generate Literal Instance for wrapper.

Example for input 6: instance ( Literal a a0, Literal b b0, Literal c c0, Literal d d0, Literal e e0 , Literal f f0, Literal g g0 ) => Literal (a -> b -> c -> d -> e -> f -> IO g) R.ExtPtr where mkSEXP = funToSEXP wrap6 fromSEXP = error "Unimplemented."