-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Java interop via inline Java code in Haskell modules. -- -- Please see README.md. @package inline-java @version 0.9.0 -- | This module contains Cabal Setup.hs hooks to set the -- CLASSPATH to use when compiling inline code. The -- CLASSPATH environment variable specifies where to find JVM -- package dependencies, such as third party packages downloaded from -- Maven Central. -- -- You can set the CLASSPATH manually, or extract one from an -- external build system configuration. Currently supported build -- systems: -- -- module Language.Java.Inline.Cabal -- | Adds the prependClasspathWithGradle and gradleBuild -- hooks. -- -- Also adds the jar produced by gradle to the data-files. gradleHooks :: UserHooks -> UserHooks -- | Prepends the CLASSPATH with the classpath from a Gradle build -- configuration. prependClasspathWithGradle :: Args -> b -> IO HookedBuildInfo -- | Call gradle build as part of the Cabal build. Useful to e.g. -- build auxiliary Java source code and to create packages. gradleBuild :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () -- | Prepends the given jar paths to the CLASSPATH. addJarsToClasspath :: [FilePath] -> UserHooks -> UserHooks -- | Internal module defining some magic, kept separate from the rest, that -- depends on compiler internals. module Language.Java.Inline.Internal.Magic -- | The bytecode corresponding to a java class data DotClass DotClass :: String -> ByteString -> DotClass [className] :: DotClass -> String [classBytecode] :: DotClass -> ByteString data JavaImport JavaImport :: String -> Integer -> JavaImport -- | Runs the given function for every class in the bytecode table. forEachDotClass :: (DotClass -> IO ()) -> IO () -- | Produces a Java class name from a package and a module name. mangleClassName :: String -> String -> String instance Language.Haskell.TH.Syntax.Lift Language.Java.Inline.Internal.Magic.JavaImport instance Data.Data.Data Language.Java.Inline.Internal.Magic.JavaImport -- |

Inline Java quasiquotation

-- -- See the GHC manual for an introduction to quasiquotation. The -- quasiquoter exported in this module allows embedding arbitrary Java -- expressions and blocks of statements inside Haskell code. You can call -- any Java method and define arbitrary inline code using Java syntax. No -- FFI required. -- -- Here is the same example as in Language.Java, but with inline -- Java calls: -- --
--   {-# LANGUAGE DataKinds #-}
--   {-# LANGUAGE QuasiQuotes #-}
--   module Object where
--   
--   import Language.Java as J
--   import Language.Java.Inline
--   
--   newtype Object = Object (J ('Class "java.lang.Object"))
--   instance Coercible Object
--   
--   clone :: Object -> IO Object
--   clone obj = [java| $obj.clone() |]
--   
--   equals :: Object -> Object -> IO Bool
--   equals obj1 obj2 = [java| $obj1.equals($obj2) |]
--   
--   ...
--   
module Language.Java.Inline.Internal javaWithConfig :: QQConfig -> QuasiQuoter -- | Customizes how quasiquotations are desugared. data QQConfig QQConfig :: Name -> ([ExpQ] -> ExpQ) -> (ExpQ -> ExpQ) -> QQConfig -- | This is the name of the function to use to indicate to the plugin the -- presence of a java quasiquotation. [qqMarker] :: QQConfig -> Name -- | This produces the call invoke the Java stub. It takes the list of -- arguments that should be passed to the call. [qqCallStatic] :: QQConfig -> [ExpQ] -> ExpQ -- | This is given as argument the invocation of the Java stub, and is -- expected to prepend it with code that ensures that the stub is -- previously loaded in the JVM. [qqWrapMarker] :: QQConfig -> ExpQ -> ExpQ -- | Declares import statements to be included in the java -- compilation unit. e.g. -- --
--   imports "java.util.*"
--   
imports :: String -> Q [Dec] -- | Idempotent action that loads all wrappers in every module of the -- current program into the JVM. You shouldn't need to call this -- yourself. loadJavaWrappers :: IO () module Language.Java.Inline.Internal.QQMarker -- | A function to indicate to the plugin the occurrence of java -- quasiquotations qqMarker :: forall k (args_tys :: k) tyres (input :: Symbol) (mname :: Symbol) (antiqs :: Symbol) (line :: Nat) args_tuple b m. (tyres ~ Ty b, Coercibles args_tuple args_tys, Coercible b, HasCallStack) => Proxy input -> Proxy mname -> Proxy antiqs -> Proxy line -> args_tuple -> Proxy args_tys -> (args_tuple -> m b) -> m b class Coercibles xs (tys :: k) | xs -> tys instance Language.Java.Inline.Internal.QQMarker.Coercibles () () instance forall k (ty :: Foreign.JNI.Types.JType) x xs (tys :: k). (ty GHC.Types.~ Language.Java.Unsafe.Ty x, Language.Java.Unsafe.Coercible x, Language.Java.Inline.Internal.QQMarker.Coercibles xs tys) => Language.Java.Inline.Internal.QQMarker.Coercibles (x, xs) '(ty, tys) module Language.Java.Inline.Internal.QQMarker.Names -- | Get the names of all markers used for java quasiquotations. getQQMarkers :: CoreM [Name] -- | This plugin generates Java bytecode from modules using the java -- QuasiQuoter and inserts it in a global bytecode table from where it is -- loaded at runtime. module Language.Java.Inline.Plugin plugin :: Plugin -- |

Inline Java quasiquotation

-- -- See the GHC manual for an introduction to quasiquotation. The -- quasiquoter exported in this module allows embedding arbitrary Java -- expressions and blocks of statements inside Haskell code. You can call -- any Java method and define arbitrary inline code using Java syntax. No -- FFI required. -- -- Here is the same example as in Language.Java, but with inline -- Java calls: -- --
--   {-# LANGUAGE DataKinds #-}
--   {-# LANGUAGE QuasiQuotes #-}
--   module Object where
--   
--   import Language.Java as J
--   import Language.Java.Inline.Unsafe
--   
--   newtype Object = Object (J ('Class "java.lang.Object"))
--   instance Coercible Object
--   
--   clone :: Object -> IO Object
--   clone obj = [java| $obj.clone() |]
--   
--   equals :: Object -> Object -> IO Bool
--   equals obj1 obj2 = [java| $obj1.equals($obj2) |]
--   
--   ...
--   
-- -- The functions in this module are considered unsafe in opposition to -- those in Language.Java.Inline.Safe, which ensure that local -- references are not leaked. module Language.Java.Inline.Unsafe -- | Java code quasiquoter. Example: -- --
--   imports "javax.swing.JOptionPane"
--   
--   hello :: IO ()
--   hello = do
--       message <- reflect ("Hello World!" :: Text)
--       [java| JOptionPane.showMessageDialog(null, $message) |]
--   
-- -- A quasiquote is a snippet of Java code. The code is assumed to be a -- block (sequence of statements) if the first non whitespace character -- is a { (curly brace) character. Otherwise it's parsed as an -- expression. Variables with an initial $ (dollar) sign are -- allowed. They have a special meaning: they stand for antiqotation -- variables (think of them as format specifiers in printf format -- string). An antiquotation variable $foo is well-scoped if -- there exists a variable with the name foo in the Haskell -- context of the quasiquote, whose type is Coercible to a Java -- primitive or reference type. java :: QuasiQuoter -- | Declares import statements to be included in the java -- compilation unit. e.g. -- --
--   imports "java.util.*"
--   
imports :: String -> Q [Dec] -- | Idempotent action that loads all wrappers in every module of the -- current program into the JVM. You shouldn't need to call this -- yourself. loadJavaWrappers :: IO () -- | This module reexports Language.Java.Inline.Unsafe. module Language.Java.Inline