-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | J in Haskell -- -- Haskell library for calling J @package j @version 0.1.2.0 -- | Marshal a limited subset of J arrays into Repa arrays. -- --
-- xs := 1 2 3 -- ys := 2 4 6 -- -- reg_result =: ys %. xs ^/ i.2 ---- -- To do this with Haskell data: -- --
-- do -- jenv <- jinit libLinux -- -- let hsArr0 = R.fromListUnboxed (R.ix1 3) [1.0,2.0,3.0] -- hsArr1 = R.fromListUnboxed (R.ix1 3) [2.0,4.0,6.0] -- jArr0 = JDoubleArr $ R.copyS $ R.map (realToFrac :: Double -> CDouble) hsArr0 -- jArr1 = JDoubleArr $ R.copyS $ R.map (realToFrac :: Double -> CDouble) hsArr1 -- -- setJData jenv "xs" jArr0 -- setJData jenv "ys" jArr1 -- -- bsDispatch jenv "reg_result =: ys %. xs ^/ i.2" -- -- JDoubleArr res <- getJData jenv "reg_result" -- R.toList res ---- -- There are three steps to do the calculation, plus one to get a J -- environment. -- --
-- do -- jenv <- jinit libLinux -- jLoad jenv (linuxProfile "9.01") -- bsDispatch jenv "load'tables/csv'" -- ---- -- This will load the CSV addon, assuming it is installed. -- --
-- since 0.1.2.0 --jLoad :: JEnv -> Profile -> IO () data Profile Profile :: ByteString -> ByteString -> ByteString -> Profile -- |
-- profile.ijs --[profPath] :: Profile -> ByteString [binPath] :: Profile -> ByteString [dllName] :: Profile -> ByteString linuxProfile :: ByteString -> Profile macProfile :: JVersion -> Profile windowsProfile :: JVersion -> Profile -- | Expected RawFilePath to the library on a Linux machine. libLinux :: RawFilePath -- | Expected RawFilePath to the library on Mac. libMac :: JVersion -> RawFilePath profLinux :: ByteString -> ByteString -- | Send some J code to the environment. bsDispatch :: JEnv -> ByteString -> IO () -- | Read last output -- -- For debugging bsOut :: JEnv -> IO ByteString type JVersion = [Int] -- | J data backed by repa array data JData sh JIntArr :: !Array F sh CInt -> JData sh JDoubleArr :: !Array F sh CDouble -> JData sh JBoolArr :: !Array F sh CChar -> JData sh JString :: !ByteString -> JData sh -- | <math> in the array size getJData :: Shape sh => JEnv -> ByteString -> IO (JData sh) -- | <math> in the array size setJData :: Shape sh => JEnv -> ByteString -> JData sh -> IO CInt -- | Abstract context data J type JDoType = Ptr J -> CString -> IO CInt type JGetMType = Ptr J -> CString -> Ptr CLLong -> Ptr CLLong -> Ptr (Ptr CLLong) -> Ptr (Ptr CChar) -> IO CInt type JGetRType = Ptr J -> IO CString type JSetAType = Ptr J -> CLLong -> CString -> CLLong -> Ptr () -> IO CInt