Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE ForeignFunctionInterface #-}
- {-# LANGUAGE QuasiQuotes #-}
- {-# LANGUAGE TemplateHaskell #-}
- module Main where
- import qualified Language.C.Inline.Cpp as C
- C.context C.cppCtx
- C.include "<iostream>"
- C.include "Owen.hpp"
- C.include "<boost/math/special_functions/owens_t.hpp>"
- cppTest :: C.CDouble -> C.CDouble -> IO ()
- cppTest h a = do
- [C.block| void {
- std::cout << "Hello, Owen! " << boost::math::owens_t($(double h), $(double a)) << std::endl;
- {
- std::cout << "Conversion function" << std::endl;
- Knot k = Knot(10);
- double km = 100;
- std::cout << "10 knots + 100km=" << k + km << std::endl;
- }
- } |]
- main :: IO ()
- main = cppTest 2 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement