Last active
September 29, 2017 20:42
-
-
Save msgodf/15d90ea62b86ef82c856bae56bd91445 to your computer and use it in GitHub Desktop.
Example of Eta code that gives `java.lang.VerifyError: Bad type on operand stack` error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
module Main where | |
import Java | |
import Java.Do | |
main :: IO () | |
main = putStrLn $ | |
mconcat $ | |
fmap (\x -> let _ = x :: JInteger in show x) $ | |
fromJava $ | |
funApply2 (toJavaFun mkList) $ toJava (3 :: Int) | |
mkList :: JInteger -> (List JInteger) | |
mkList x = toJava [x] | |
foreign import java unsafe "@interface apply" funApply2 :: (Extends t Object, Extends r Object) => Function t r -> t -> r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gives the following output: