inline-java: Java interop via inline Java code in Haskell modules.

[ bsd3, deprecated, ffi, java, jvm, library ] [ Propose Tags ]
Deprecated.

Please see README.md.


[Skip to Readme]
Versions [RSS] [faq] 0.1, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.10.0 (info)
Dependencies base (>4.9.0.0 && <5), binary (>=0.7), bytestring (>=0.10), containers (>=0.5), distributed-closure (>=0.3), filepath (>=1), ghc-heap-view (>=0.5), inline-c (>=0.5), jni (>=0.1), jvm (>=0.1), language-java (>=0.2), monad-loops (>=0.4), process (>=1.2), singletons (>=2.0), syb (>=0.6), template-haskell (>=2.10), temporary (>=1.2), text (>=1.2), thread-local-storage (>=0.1), vector (>=0.11) [details]
License BSD-3-Clause
Copyright 2015-2016 EURL Tweag.
Author Tweag I/O
Maintainer m@tweag.io
Category FFI, JVM, Java
Home page http://github.com/tweag/inline-java#readme
Source repo head: git clone https://github.com/tweag/inline-java
Uploaded by MathieuBoespflug at 2016-10-19T14:12:15Z
Distributions NixOS:0.10.0
Downloads 10126 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-11-14 [all 3 reports]

Modules

  • Language
    • Java
      • Language.Java.Inline

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for inline-java-0.5

[back to package description]

inline-java: Call any JVM function from Haskell

Circle CI

NOTE: you'll need GHC >= 8.0.2 to compile and use this package. Use stack --nix --stack-yaml stack-HEAD.yaml build ahead of a new GHC release.

The Haskell standard includes a native foreign function interface (FFI). It can be a pain to use and in any case only C support is implemented in GHC. inline-java lets you call any JVM function directly, from Haskell, without the need to write your own foreign import declarations using the FFI. In the style of inline-c for C and inline-r for calling R, inline-java lets you name any function to call inline in your code.

Example

Graphical Hello World using Java Swing:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where

import Data.Int
import Language.Java
import Language.Java.Inline

main :: IO Int32
main = withJVM [] $ do
    message <- reflect "Hello World!"
    [java| { javax.swing.JOptionPane.showMessageDialog(null, $message);
             return 0; } |]

License

Copyright (c) 2015-2016 EURL Tweag.

All rights reserved.

inline-java is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Tweag I/O

inline-java is maintained by Tweag I/O.

Have questions? Need help? Tweet at @tweagio.